-
Help with query involving nulls
Hi All.
I am unable to retrieve records with a zero dollar amount or is null when the user selects '0' from the combobox on a form. I have the following in the criteria on my query:
IIf(([forms]![form1]![combo2]=0),([tblApprovalAmounts].[AMOUNT]) Is Null Or ([tblApprovalAmounts].[AMOUNT])=0,[forms]![form1]![combo2])
Any ideas on what may be wrong?
Thank you for your help.
-
I think it's a synax issue. Remember IIF is three parts: Logical Test, Value if True, Value if False. (Similar to a ternary operator.) If I take apart your statment it is:
Test: ([forms]![form1]![combo2]=0)
True: ([tblApprovalAmounts].[AMOUNT]) Is Null Or ([tblApprovalAmounts].[AMOUNT])=0
False: [forms]![form1]![combo2]
Which makes it look like you have part of your test in the true statement... Or was it your intention to perform a bitwise operation in your true statement?
Cordially,
Aaron
Keep Our Board Clean! - Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
- Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules