Letting users choose how report is sorted

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report that can be sorted many different ways. Rather than having 10
versions of the report each sorted a different way, how do I let users choose
the way they want? I know it's done using a form, but how do I do this?
Thanks in advance.
 
On the form have a combo box listing the names of the fields on which the
report can be sorted, so that the user can select one. Open the report from
a button on the form. In the report's Open event procedure set its Order and
OrderByOn properties:

Me.OrderBy = Forms!YourForm!YourComboBox
Me.OrderByOn = True

If you want the form to be closed when the report is run do this after
setting the properties as above with:

DoCmd.Close acForm, "YourForm"

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top