Query on certain fields, but not all

T

tmwilkin

There is probably a simple answer for this, but I have a form set up with 3
text boxes and a run-query button. For the query to return results, you need
to fill in a value in each of the 3 fields. I would like to get it to where
only 1 of the fields is required and the other 2 are optional to query for
more specific information. Can anyone assist me in setting this up?

Thanks,
Todd
 
K

Klatuu

Here is the example from a Criteria cell in a stored query that may give you
some ideas. Basically, if the control on the form has no entry, it will not
filter on the column, but if it has an entry, it will filter on that entry.
You just need the same sort of logic for each of the fields on which you are
filtering.

Like
IIf(IsNull([Forms]![WorkFlowMgr]![cboClient]),"*",[Forms]![WorkFlowMgr]![cboClient])
 
Top