Perhaps its better to have several search boxes, one for each column;
Yes, then use code to build an SQL string for a Select query from the
criteria supplied, so you'd end up with something like:
"SELECT * FROM Items WHERE MyDate = #" & MyForm.txtDateCriteria & "# AND
Description Like '*" & MyForm.txtDescriptionCriteria & "*'"
Then change the Recordsource of your "display" form/subform to that SQL
string. If the user clears all criteria then the recordsource reverts back
to "SELECT * FROM Items".
If you need to apply a criteria to more than one field, something like:
"WHERE MyDescription = '" & MyForm.txtDescrCriteria & "' OR MySubDescription
= '" & MyForm.txtDescrCriteria & "'"
All this can be *very* tricky. It may be easy to build an SQL string if the
user supplies criteria for all allowable (3?) fields, but you also need to
have your code build a valid SQL string if the user wants to filter on fewer
than "all" fields. Other things you might have to address: allow date ranges
(i.e., BETWEEN)?, allow greater than or less than date criterias?, allow the
user to save criteria with a name for later recall? allow user to save
results, or just view them?.
Suggestion: start with one or two fields and keep it simple (while keeping
flexibility for future growth in mind). Add more functionality once you have
a "basic" search up & running. You may find that requests for additional
bells & whistles will be a never ending battle, so focus on getting it right
in acheivable phases.
Note: Date is a reserved keyword. It is a *very, very, very* good idea to
name the field something other than that. You can use it as a label or
caption, but the actual field name should be something different.
HTH,