View Full Version : IIF Statement in a Parameter Query


Capilano
01-04-2002, 12:06 PM
I am quite familiar with IIF statements and using them in as the criteria in Select Query. My problem is that I want to have all of the records returned (no criteria) if the Expression part is Null.

The following works, but it is not what I need...

IIf(IsNull(Forms![Form1]![Field1]),"Member","Non Member")

The syntax above works as designed and returns all of the records with "Member". I have tried to modify the syntax using a wildcard so as to reflect what I really want but to no avail. Instead, the following brings back no records instead of all of them.

IIf(IsNull(Forms![Form1]![Field1]),Like "*","Non Member")

or

IIf(IsNull(Forms![Form1]![Field1]),"Like "*"","Non Member")

Neither works! Any suggestions

Thanks In advance

Pat

pcs
01-05-2002, 02:21 PM
not sure i'm reading your question correctly...but think you want to place the Like operator at the beginning of your criteria expression.

something like:

Like (IIf(IsNull(Forms![Form1]![Field1]),"Member","*")

that may point you in the right direction.

hth,
al

Capilano
01-07-2002, 08:23 AM
Thanks... That worked really well.

Pat