Hi All
Can anyone help me with an IIF statement that is going wrong please?
In a query, I have the following IIF statement in the criteria of a long integer field:
IIf([Forms]![frmSupplierNCRsReviewSelection]![fraErrorCode]=1,>0, In (1,5,6,7))
The IIF statement is getting and using the value fraErrorCode (an option group on a dialogue form) just fine - if I change the IIF to say 'if fraErrorCode = 1, return 3, else return 4' - it returns all records containing value of 3 if the first option in the option group fraErrorCode is chosen, and selecting the second option in the group returns all records containing 4 in the ErrorCode field.
If I use a criteria of >0 in the query I get all records, if I use a criteria of In(1,5,6,7) I get all records that contain one of these values.
As soon as I put them in the IIF statement as above, it fails - the query returns no records.
I've tried lots of things to make this work (giving "([tblSupplierNonConformances].[Error Code])>0" intead of just >0, using switch or choose, Eval(>0) in case Access interprets >0 as text when in an IIF statement), to no avail.
Could someone tell me What am I doing wrong please?
Can anyone help me with an IIF statement that is going wrong please?
In a query, I have the following IIF statement in the criteria of a long integer field:
IIf([Forms]![frmSupplierNCRsReviewSelection]![fraErrorCode]=1,>0, In (1,5,6,7))
The IIF statement is getting and using the value fraErrorCode (an option group on a dialogue form) just fine - if I change the IIF to say 'if fraErrorCode = 1, return 3, else return 4' - it returns all records containing value of 3 if the first option in the option group fraErrorCode is chosen, and selecting the second option in the group returns all records containing 4 in the ErrorCode field.
If I use a criteria of >0 in the query I get all records, if I use a criteria of In(1,5,6,7) I get all records that contain one of these values.
As soon as I put them in the IIF statement as above, it fails - the query returns no records.
I've tried lots of things to make this work (giving "([tblSupplierNonConformances].[Error Code])>0" intead of just >0, using switch or choose, Eval(>0) in case Access interprets >0 as text when in an IIF statement), to no avail.
Could someone tell me What am I doing wrong please?