I'm trying to design a query in Access 2007 that will select clinicians based upon a list of desired counties and specialties. The query receives its parameters from a form where the searcher may choose their desired counties and specialties from two multiselect menus. At present, it works wonderfully assuming that selections have been made. However, I am trying to design it such that if no selection is made, the query will show all specialties and/or counties. I found a nifty little demo that includes just such a function here:
http://www.blueclaw-db.com/multi_select_parameter_form.htm
They use this simple command in their WHERE statement:
in (select state from t_states) or dlookup("Count(state)","T_States")=0
Where 'state' is a field of the table, 'T_States,' which holds the selected parameters.
This works beautifully in their demo, but I can't get it to work in my query for one, let alone two, multiselect parameters. The query simply returns empty - no error messages. Any ideas?
I know that a subquery would be an alternative option, but I am rather new to their use and am unclear how I should design one to suit my needs here.