Search code examples
ms-accessnullvba

How to check for Is Not Null in VBA?


Hi I have the following expression. I'm trying to say "if the second field Is Not Null". Can you help.

Thanks

=Iif((Fields!approved.Value = "N" & Fields!W_O_Count.Value IsNotNull), "Red", "Transparent")

Solution

  • Use Not IsNull(Fields!W_O_Count.Value)

    So:

    =IIF(Fields!approved.Value = "N" & Not IsNull(Fields!W_O_Count.Value)), "Red", "Transparent")