View Full Version : IIF Help


snodrift1
09-13-2006, 10:47 AM
How do I make this Work. I know it should be easy but I just can't get it.


If text159 is blank and the Stage field is equal to 4 then make blank otherwise show the Quantity.

=IIF([Text159]="", and [Stage]=4,"",[Quantity])

So if both are True then Blank but if [Text159] is false and [Stage] is True then Quantity.

grnzbra
09-13-2006, 11:17 AM
Take the comma out from between the two conditions.

WayneRyan
09-13-2006, 11:21 AM
Sno,

Can a Textbox be True?

=IIF(Len([Text159]) > 0 And [Stage] = 4, [Quantity], "")

or

=IIF(Len([Text159]) > 0 And [Stage] = 4, [Quantity], 0)

Need more info, but hope that gets you started.

Wayne

grnzbra
09-13-2006, 02:08 PM
Sno,

Can a Textbox be True?



I believe it can be

IIf([Text159] AND [Stage] = 4,...

It may depend on what "blank" means.

Should work, but it drove one of my bosses absolutely crazy when she saw it.

Pat Hartman
09-13-2006, 08:11 PM
Don't confuse zero-length strings which are "" with Nulls. They are not the same value.
Do not use "" as a value for numeric fields.
This -- =IIF(Len([Text159]) > 0 And [Stage] = 4, [Quantity], "")
should be -- =IIF(Len([Text159]) > 0 And [Stage] = 4, [Quantity], Null)