IIF Expression in criteria (1 Viewer)

Monardo

Registered User.
Local time
Today, 06:18
Joined
Mar 14, 2008
Messages
70
Dear All

I have a feeling there must be extremely simple solution, but I spent whole day without success.

I have a form with combo box [Combo18] with the following options:

All
V01
V02
V03

After one of the options is selected I want to run query, where criteria is based on the selected value above.

In the criteria I put the following expression:

Code:
IIF([Forms]![f_80_list_menu]![Combo18]="All",Like "*",[Forms]![f_80_list_menu]![Combo18])
It works perfectly if selected values are not "All", but selects nothing otherwise.

In the place of /Like "*"/ I tried:

""
"*"
Null
Is Not Null
'Like "*"'
and many other combinations, but no result.

Please help
 

pr2-eugin

Super Moderator
Local time
Today, 04:18
Joined
Nov 30, 2011
Messages
8,494
Like is an operator so should be placed before the IIF condition as such..
Code:
[COLOR=Red][B]Like[/B][/COLOR] IIF([Forms]![f_80_list_menu]![Combo18]="All","*",[Forms]![f_80_list_menu]![Combo18])
 

Monardo

Registered User.
Local time
Today, 06:18
Joined
Mar 14, 2008
Messages
70
Ah, thank a million Paul.

So simple when you already know...
 

Users who are viewing this thread

Top Bottom