Sorting a Report Based on Criteria

  • Thread starter Thread starter Sharon Greene
  • Start date Start date
S

Sharon Greene

I have a report that I would like to sort based on user-entered criteria.
There are two option groups in my form. Each option group has four fields
(Name, Title, Date, ID) that the user can search. The user would select one
option from each group. The first group is the primary sort and the second
option group is for the secondary sort.

For example, if the user selects Name from the Primary option group and Date
from the Secondary option group, the report should be sorted by Name and then
by Date.

What code can I use to enable the user to search this way?
 
Use a calculated field in your query ---
SortOrder1: IIF([Forms]![FormName]![Frame1] = 1, [Field_X], [Field_Y])
Nest more IIF's for more sorts options.

Then build your 2nd sort order.
 
Back
Top