B
bw
The Field for my SQL Statement Query Builder is E1: Left([Mnemonic],2)
When I have the Criteria as follows, it works fine:
Is Not Null And IIf([Forms]![boxStatusReport]![PrintOneOrAll]=3,"CL")
But if I want to check more values, like this:
Is Not Null And IIf([Forms]![boxStatusReport]![PrintOneOrAll]=3,"CL" or
"WX")
Access is changing my code to the following:
Is Not Null And
IIf([Forms]![boxStatusReport]![PrintOneOrAll]=3,(Left([mnemonic],2))="CL" Or
(Left([mnemonic],2))="WX")
and giving me the following error message when [PrintOneOrAll]=3:
"This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables."
Can someone explain the proper way to do what I'm trying to do? By the way,
additional values on separate lines of the criteria as there will be more
values than the two that I have shown here.
Thanks,
Bernie
When I have the Criteria as follows, it works fine:
Is Not Null And IIf([Forms]![boxStatusReport]![PrintOneOrAll]=3,"CL")
But if I want to check more values, like this:
Is Not Null And IIf([Forms]![boxStatusReport]![PrintOneOrAll]=3,"CL" or
"WX")
Access is changing my code to the following:
Is Not Null And
IIf([Forms]![boxStatusReport]![PrintOneOrAll]=3,(Left([mnemonic],2))="CL" Or
(Left([mnemonic],2))="WX")
and giving me the following error message when [PrintOneOrAll]=3:
"This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables."
Can someone explain the proper way to do what I'm trying to do? By the way,
additional values on separate lines of the criteria as there will be more
values than the two that I have shown here.
Thanks,
Bernie