Wildcard in IIF

C

Curt

Is it possible to use the wildcard (*) in either the true
or false portion in an IIF statement that is placed in a
criteria cell of a select query.

For example:
IIF([combo8]= "All",*,[combo8]).

If this is possible, what is the correct syntax. It
doesn't work in this form.

Thank you for any help.

Curt
 
G

Guest

Duane,

Thank you for your help. Unfortunately, when I try the
syntax you indicated, I get zero (0) records returned,
instead of all of them. Do I need to include the LIKE
portion as well? Any help is appreciated

Curt
-----Original Message-----
Like IIF(Forms!frmA![combo8]= "All","*",Forms!frmA! [combo8]).


--
Duane Hookom
MS Access MVP


Is it possible to use the wildcard (*) in either the true
or false portion in an IIF statement that is placed in a
criteria cell of a select query.

For example:
IIF([combo8]= "All",*,[combo8]).

If this is possible, what is the correct syntax. It
doesn't work in this form.

Thank you for any help.

Curt


.
 
J

JohnFol

or just use the following as the criteria

= Forms!frmA![combo8] or Forms!frmA![combo8]= "All"

Duane,

Thank you for your help. Unfortunately, when I try the
syntax you indicated, I get zero (0) records returned,
instead of all of them. Do I need to include the LIKE
portion as well? Any help is appreciated

Curt
-----Original Message-----
Like IIF(Forms!frmA![combo8]= "All","*",Forms!frmA! [combo8]).


--
Duane Hookom
MS Access MVP


Is it possible to use the wildcard (*) in either the true
or false portion in an IIF statement that is placed in a
criteria cell of a select query.

For example:
IIF([combo8]= "All",*,[combo8]).

If this is possible, what is the correct syntax. It
doesn't work in this form.

Thank you for any help.

Curt


.
 
J

Jeff Boyce

Pardon my intrusion, but I believe Duane's response was complete -- you need
to use ALL of it, including the LIKE.

If you were not using the IIF() function, and only wished to look for all,
does

Like *

work as expected?

Good luck

Jeff Boyce
<Access MVP>

Duane,

Thank you for your help. Unfortunately, when I try the
syntax you indicated, I get zero (0) records returned,
instead of all of them. Do I need to include the LIKE
portion as well? Any help is appreciated

Curt
-----Original Message-----
Like IIF(Forms!frmA![combo8]= "All","*",Forms!frmA! [combo8]).


--
Duane Hookom
MS Access MVP


Is it possible to use the wildcard (*) in either the true
or false portion in an IIF statement that is placed in a
criteria cell of a select query.

For example:
IIF([combo8]= "All",*,[combo8]).

If this is possible, what is the correct syntax. It
doesn't work in this form.

Thank you for any help.

Curt


.
 
P

Pachydermitis

Let's say the fieldname you are limiting is [FirstName]
put this in the criteria:
IIF(Forms!frmA![combo8]= "All",[FirstName],Forms!frmA![combo8]).
HTH
Pachydermitis

Duane,

Thank you for your help. Unfortunately, when I try the
syntax you indicated, I get zero (0) records returned,
instead of all of them. Do I need to include the LIKE
portion as well? Any help is appreciated

Curt
-----Original Message-----
Like IIF(Forms!frmA![combo8]= "All","*",Forms!frmA! [combo8]).


--
Duane Hookom
MS Access MVP


Is it possible to use the wildcard (*) in either the true
or false portion in an IIF statement that is placed in a
criteria cell of a select query.

For example:
IIF([combo8]= "All",*,[combo8]).

If this is possible, what is the correct syntax. It
doesn't work in this form.

Thank you for any help.

Curt


.
 

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