so write the query on the fly, only includeing the terms that the user specifies
personally I prefer handling this sort of problem using a data entry form which verifies the user supplied parameters are 'sane' / valid. then pass those details to your reporting switchboard / menu and pull the values for the query from that switchboard/menu
you cna pass values between forms / reports / queries by explicitly defining the varaiable or control. these can either be 'pushed' from the data capture form to another or pulled from the data capture form.
to push values..
the target form / report has to be already open
forms!targetformname!targetcontrolname = thiscontrol.value
to pull values (which is my preferred stylistic)
the datacapture form has to be open
in the target form
myvariablename = forms!datacaptureformname!controlname.
as an overview
fromt eh report switchboard
the user select the datacapture form, it opens with sane defaults pulled from the switchboard
the datacapture form validates the user input (checks for sane values / good dates and so on)
the datacapture form has on OK & cancel button
if the user presses OK the values from the datacaptrue form are pushed to controls on the switchboard, if they press cancel nothing is posted back.
the user then selects wahtever reports / forms they want with those filter criteira.
the query is written on the fly
strWhereClause = "Where 1=1 "
if not isnull(mynumericcontrol) then 'we are assuming its got valid data in int
strWhereClause = strWhereClause & " AND anumericcolumn = " & mynumericcontrol
if not isnull(mystringcontrol) then 'we are assuming its got valid data in int
strWhereClause = strWhereClause & " AND astringcolumn = '" & mystringcontrol & "'"
'note the ' encapsualtes the string literal from mystringcontrol
if not isnull(mydatecontrol) and isdate(mydatecontrol) then 'we are assuming its got valid data in int
strWhereClause = strWhereClause & " AND adatecolumn = #" & format(mydatecontrol,"mm/dd/yyyy" & "#"
'note the # encapsualtes the string literal from mystringcontrol
I'd rather be riding on the Tiger 800 or the Norton