passing sort criteria from form to query

  • Thread starter Thread starter Gonzosez
  • Start date Start date
G

Gonzosez

I have a report on the form the user is asked how to sort the report
ascending or descending. How can I pass this to the query?
I do not want to have 2 queries.
 
Gonzosez said:
I have a report on the form the user is asked how to sort the report
ascending or descending. How can I pass this to the query?
I do not want to have 2 queries.


Actually, a report's sorting is specified in its Sorting and
Grouping, not in a query (this is different from forms).

Set the field you want to sort by in Sorting and Grouping
(View menu when in report design view). Set it to sort
Ascending.

Then use the report's Open event to change it to Descending
using code something like:

If MsgBox("Sort Descending", vbYesNo) = vbYes Then
Me.GroupLevel(0).SortOrder = True
End If
 

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