Hi there!
I have a form that contains a variety of query buttons based on simple "yes / no" fields. What I'm attempting to do is filter the results of the query by a combo box in such a way that, if no option is chosen all results are displayed, and if an option from the combo box is selected, the results are limited to those matching that criteria as well.
For example, one button opens a query that indicates whether an air compressor is present. The query opens a datasheet that lists all entries in which an air compressor is present. I'd like to be able to limit the results to, say, air compressors located in a particular city.
To get the air compressor results, I'm simply using the criteria "Yes" in the air compressor field. In an attempt to filter those results to a city, I'm using the following formula:
IIf(IsNull([Forms]![frm_SearchResource]![cmbo_SRFilterCity],"*",[Forms]![frm_SearchResource]![cmbo_SRFilterCity]))
which reads (to my untrained eye) like this: If SRFilterCity is null, then show all results. Otherwise, show the results indicated by the SRFilterCity combo box results.
However, I get the following error when I try to save the query:
"The expression you entered has a function containing the wrong number of arguments"
So... what am I doing wrong? Any advice would be appreciated.