Is it possible to return no value when an If statement is true?

ST4RCUTTER

Registered User.
Local time
Yesterday, 22:44
Joined
Aug 31, 2006
Messages
94
This should be really simple, but I am stumbling on the criteria. I have a combo box which returns "Y" or "N". I'm using this value as criteria for a field called [Planned=Y/N]. This field stores either a "Y" or a "N" to indicate that a network outage was planned or not. If the combo box is "Y" I want to return all values(Y and N). If the combo box is "N" I only want to return values of "N". I've tried the following in the criteria without the desired affect:

IIf([Forms]![frmOutagemenu]![cboflag]="Y","","N") - only returns records when "N" is selected.

IIf([Forms]![frmOutagemenu]![cboflag]="Y",null,"N") - only returns records when "N" is selected.

IIf([Forms]![frmOutagemenu]![cboflag]="Y",In("Y","N"),"N") - too complicated for Access to decode.

Is there another way to return nothing for the criteria when "Y" is selected?
 
Maybe something like this?
IIf([Forms]![frmOutagemenu]![cboflag]="Y","*","N")
 
IIf([Forms]![frmOutagemenu]![cboflag]="Y", [Planned=Y/N], "N")
.
 
Jon K,

Ugh...that's so obvious now. Sometimes you can't see the trees for the forest.:rolleyes:

Thanks!
 

Users who are viewing this thread

Back
Top Bottom