Query Criteria with a wilcard

RevJeff

Registered User.
Local time
Yesterday, 19:15
Joined
Sep 18, 2002
Messages
129
Hello,

I am trying to setup a query that looks at a ComboBox named "Location". If "All" is selected in the ComboBox, I want everything displayed in the query, but if a certain location is selected, then the query only displays that locations information. That part works fine. It's that "All" part that I am having issues with. Below is the code I have in the Criteria field in the query.

Code:
IIf([Forms]![frmDashboard]![Location]="All",Like "*",[Forms]![frmDashboard]![Location])

Thanks for your help.
 
You don't need the "All" , have it default to Null value, then in the criteria put the following

Code:
=[Forms]![frmDashboard]![Location] Or [Forms]![frmDashboard]![Location] Is Null

This will bring back all values if the combo is null, and can be repeated for multiple combo's.
 
That works perfectly! Thank you!
 

Users who are viewing this thread

Back
Top Bottom