bobmillington
asked on
Access 2010 (Iff Statement)
I have the following iff statement.
=IIf(([OctPayStatus]="0") And ([OctPayment]>"0"),"Unpaid ","Paid")
OctPayStatus is a checkbox and OctPayment is a numeric value. I am trying to get the following answered: If the OctPayStatus is not checked and OctPayment has a value greater than 0 then show Unpaid else show paid.
Access tells me I have a circular reference on the control property......
A little push would be greatly appreciated.
Cheers,
Bob
=IIf(([OctPayStatus]="0") And ([OctPayment]>"0"),"Unpaid
OctPayStatus is a checkbox and OctPayment is a numeric value. I am trying to get the following answered: If the OctPayStatus is not checked and OctPayment has a value greater than 0 then show Unpaid else show paid.
Access tells me I have a circular reference on the control property......
A little push would be greatly appreciated.
Cheers,
Bob
ASKER
Ok, tried this code as sugguested..
=IIf([OctPayStatus]=0 And [OctPayment]>0,"Unpaid","P aid")
It returns the Paid records ok, but the unpaids show #Type! where "Unpaid" should be. Also, the control box tells me of a cirular reference.
I dont understand it. I tried this code =IIf([OctPayStatus]=0,"Unp aid","Paid ") and it shows the right values......its when I add the and part it fails.
=IIf([OctPayStatus]=0 And [OctPayment]>0,"Unpaid","P
It returns the Paid records ok, but the unpaids show #Type! where "Unpaid" should be. Also, the control box tells me of a cirular reference.
I dont understand it. I tried this code =IIf([OctPayStatus]=0,"Unp
ASKER
Looks like the problem is with the OctPayment field. I tried
=IIf([OctPayment]=0,"No Value","Value")
and I get the same #type! error. The OctPayment field is a currency field....just doesn't make sense.
=IIf([OctPayment]=0,"No Value","Value")
and I get the same #type! error. The OctPayment field is a currency field....just doesn't make sense.
OctPayment may be NULL
(Null is not the same as zero)
So try
=IIf(IsNull([OctPayment]), "No Value","Value")
...as a test
If this is the issue, I am sure capricorn1 can get you sorted the rest of the way...
(so no points wanted for me)
;-)
JeffCoachman
(Null is not the same as zero)
So try
=IIf(IsNull([OctPayment]),
...as a test
If this is the issue, I am sure capricorn1 can get you sorted the rest of the way...
(so no points wanted for me)
;-)
JeffCoachman
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just put txt in front of the control name and it magically worked. The syntax in the expression builder was good afterall.
Many Thanks!!!!!
=IIf(([OctPayStatus]=0 And [OctPayment])<>0,[OctPayme nt],"0")
Many Thanks!!!!!
=IIf(([OctPayStatus]=0 And [OctPayment])<>0,[OctPayme
=IIf([OctPayStatus]=0 And [OctPayment]>0,"Unpaid","P
or
=IIf([OctPayStatus] <> 0 And [OctPayment]>0,"Paid","Unp