Solved IIF statement with 3 conditions (1 Viewer)

Ashfaque

Student
Local time
Today, 14:15
Joined
Sep 6, 2004
Messages
894
Hi,
I am trying to deal with 3 Conditions using IIF condition.

Fields that I have CAccomByCo (Check) and CAccomAllw (Integer)

Conditions :
1. If CAccomByCo unchecked And CAccomAllw = 0 Then The Result in Text191 should be 0
2. If CAccomByCo unchecked And CAccomAllw > 0 Then The Result in Text191 should be CAccomAllw
3. If CAccomByCo checked And CAccomAllw = 0 Then The Result in Text191 should be "By Company"

But my code is producing nothing although it has no error.

Code:
=IIf(IsNull([CAccomByCo] And [CAccomAllw]=0),0,(IIf(IsNull([CAccomByCo] And [CAccomAllw]>0),[CAccomAllw]),"By Company"))

Can someone help me please....
 

isladogs

MVP / VIP
Local time
Today, 08:45
Joined
Jan 14, 2017
Messages
18,186
If CAccomByCo is a boolean value then your IIf condition should be true or false for that field.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 16:45
Joined
May 7, 2009
Messages
19,169
=Switch(CAccomAllw > 0, CAccomAllw, CAccomByCo, "By Company", True, 0)
 

Users who are viewing this thread

Top Bottom