Multiple criteria in an Iif Statement

houseofturner

Registered User.
Local time
Today, 17:09
Joined
Dec 10, 2009
Messages
37
I am using this: : IIf([TableName]![FieldName] Like "Criteria1*" Or Like "Criteria2*" Or Like "Criteria3*" Or Like "Criteria4*","Answer If True","Answer If False")

This is not returning the expected results so I must have the syntax wrong - can anyone help?

Also how would I do:

IIf([TableName]![FieldName] = "Criteria A" And [TableName]![FieldName] Like "Criteria1*" Or Like "Criteria2*" Or Like "Criteria3*" Or Like "Criteria4*","Answer If True","Answer If False")

i.e. for it to be true it must adhere to criteria a and then one of the criteria 1 - 4.

Thanks.
 
You always have to repeat the field, so:

IIf(Field1 = 1 OR Field1 = 2,...)

As to your second question, you apply your logic with parentheses.

IIf(Field1 = 1 AND (Field2 = 2 OR Field2 = 3), ...)
 

Users who are viewing this thread

Back
Top Bottom