Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How use two listboxes on a form to sort and filter a report

I have a form that contains two listboxes.  They are both multi-select listboxes.  One of them is named listSortBy and the other one is named listFilterBy.  When I have selected for example two selections in the 1st listbox named listSortBy I want to pass that information on to a report and SORT the results based on the selections in the listbox in the order they were selected.  When I have selected for example three selections in the 2st listbox named listFilterBy I want to pass that information on to a report and FILTER the results based on the selections in the listbox.  

The report currently uses a query as its recordsource.  Do I need to somehow pass the selections from the listboxes on to the query?  In other words, sorting and filtering on the report have to be dynamic based on the selections in the two listboxes rather than static which could be determined in the report design.

Complicated, I know.  Is this all even possible?

--Steve
ASKER CERTIFIED SOLUTION
Avatar of Helen Feddema
Helen Feddema
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You might not need to sort if the listbox items are already alphabetically sorted, as in my sample with state abbreviations.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial