Parameter Queries

D

DM

I've got a query with different parameter criteria
e.g.
surname = an object on a form
postcode = another object on a form.

Is it possible to enter something that will ignore that criteria so that I
can only search surname or only search postcode. Wildcards don't seem to work.
 
O

Ofer Cohen

Try something like

Select * From TableName Where surname Like IIf(Forms![FormName]![surname] Is
Null, "*" , Forms![FormName]![surname]) And postcode Like
IIf(Forms![FormName]![postcode] Is Null, "*" , Forms![FormName]![postcode])
 
Top