You can build the query in VBA code using the fields on your form.
For example, let's say you have a simple form with 4 text boxes that the users can enter info into, (Type, Color, Begin Date and End Date)
The form probably also has a command button for the user to click when he is done entering data and ready to retrieve the records. On the click event of the button, you need the following code:
Dim Criteria as string
Const dquote """" 'yes that's 4 double quotes not a typo
Criteria = ""
If not(isnull(me!type)) then
Criteria = " where type = " & me!type
end if
If not(isnull(me!color)) then
if Criteria = "" then Criteria = " where "
Criteria = Criteria & "color = " dquote & me!color & dquote
end if
If not(isnull(me!begdate)) then
if Criteria = "" then Criteria = " where "
Criteria = Criteria & "BegDate >= #" & me!begdate & "#"
end if
If not(isnull(me!enddate)) then
if Criteria = "" then Criteria = " where "
Criteria = Criteria & "EndDate <= #" & me!enddate & "#"
end if
docmd.openform "formname showing records",,,criteria
Just customize the above code to meet your needs. Maq B-)
<insert witty signature here>