Sorting a Report Based on Criteria

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?
 
K

KARL DEWEY

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.
 

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

Top