Multiple Combo Box Queries - one OR the other?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I need to create a query based on various combo boxes, the idea being the
user selects the criteria for their search by selecting parameters from
multiple combo boxes.

I have a query that works from three combo boxes, but parameters for all
three have to be selected, how can I make it so the query will work if say
only 2 out of the three parameters are set?

So basically I need to use OR somehow right?
 
Some thing like:

WHERE ...
( ( Field1 = [Forms]![YourForm]![cbo1] ) OR
( [Forms]![YourForm]![cbo1] Is Null ) ) AND
( ( Field2 = [[Forms]![YourForm]![cbo2] ) OR
( [Forms]![YourForm]![cbo2] Is Null ) ) AND
( ( Field3 = [Forms]![YourForm]![cbo3] ) OR
( [Forms]![YourForm]![cbo3] Is Null ) )
 
Back
Top