Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2003
    Posts
    26

    Unanswered: Sort report from form

    Is there a way that I can sort a report from a command button. I have a report that opens from a table with a command button. I would like the user to be able to choose from a combo box how the report should be sorted. Is there a way to call Order By or something similar then open the report?
    Life's a bowl of punch, go ahead and spike it.

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Sort report from form

    Sorting reports through forms is possible only if you have a dynamic group in your report. Then in your report you initialize the form object and see which sort options are selected.

    Depending on the selection in the form you can change the group's record source.


    Originally posted by DawG
    Is there a way that I can sort a report from a command button. I have a report that opens from a table with a command button. I would like the user to be able to choose from a combo box how the report should be sorted. Is there a way to call Order By or something similar then open the report?

  3. #3
    Join Date
    Jul 2003
    Posts
    26
    what about sorting a table? from the form.
    Life's a bowl of punch, go ahead and spike it.

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    In the Report Open put this code

    Me.OrderByOn = True
    Me.OrderBy = ([Forms]![YourFormNameContainsSortCriteria]![cmbo_YourComboBoxName])

  5. #5
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    Yes you can do this but only if you have no groups in the report

    Originally posted by hammbakka
    In the Report Open put this code

    Me.OrderByOn = True
    Me.OrderBy = ([Forms]![YourFormNameContainsSortCriteria]![cmbo_YourComboBoxName])

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •