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])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top