IIF Help

snodrift1

Registered User.
Local time
Today, 12:54
Joined
Sep 5, 2006
Messages
15
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.
 
Take the comma out from between the two conditions.
 
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
 
WayneRyan said:
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.
 
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)
 

Users who are viewing this thread

Back
Top Bottom