For starters, put your (unbound) filter controls, probably but not necessarily combo boxes, in the form header to logically separate them from any bound controls, then have a button to build the query, the code for same would be
dim sSQL as string
ssql = "SELECT * FROM [TABLE NAME] "
or
ssql = "SELECT A, B, C, etc. FROM"
'cycle through each filter control
'this gets complicated because each filter control can be a different datatype
'numeric datatype
if not isnull(me!ctrl1) then
if right(ssql,5) <> "WHERE" THEN
ssql = ssql & " WHERE FieldName1 = " & me!ctl1
else
ssql = ssql & " AND FieldName1 = " & me!ctl1
end if
end if
'text datatype
if not isnull(me!ctrl2) then
if right(ssql,5) <> "WHERE" THEN
ssql = ssql & " WHERE FieldName2 = " & chr(34) & me!ctl2 & chr(34)
else
ssql = ssql & " AND FieldName2 = " & chr(34) & me!ctl2 & chr(34)
end if
end if
'note that chr(34) is a quotation mark
'I find that that obviates the confusion of 4 adjacent quotation marks.
'date datatype
if not isnull(me!ctrl3) then
if right(ssql,5) <> "WHERE" THEN
ssql = ssql & " WHERE FieldName3 = #" & cdate(me!ctl3) & “#”
else
ssql & ssql & " AND FieldName3 = #" & cdate(me!ctl3) & “#”
end if
end if
'some time an unbound date control get interpreted as a string, so I
'always use the cdate function to convert it. The overhead is insignificant.
'keep in mind that the me!ctlis are values and must be
'concantenated to ssql as values, not strings.
'repeat as required for additional filter controls
'a true of false control can be tested as -1 and 0 (numeric), respectively.
'reset form recordsource
me.recordsource = ssql
'you may have to also requery subforms,
'depending on how they're constructed
me.requery
'ouila your filtered records will populate your form
Use the debugger to step through the the ssql construction code as it's executed, check ssql as it's modified, to make sure its a valid string.
Good luck. Hopefully this get down the path a few more steps.