Hi all,
I'm trying to return all records in a query where the value of an integer is a null value. When I simply put "Is Null" in the criteria box, the query works. The problem is I need to include an IIF statement as criteria, like so:
IIf(GetValue("variable") <> 0, GetValue("variable"), Is Null)
GetValue is a function I use in VBA to return the value of a global variable, in this case "variable". The function returns a variant. So if the value of "variable" is 0, I want to return all records where the value of the field is NULL. However, when I try to employ this strategy, the query returns NO records. Like I said, if I just put "Is Null" in the criteria, it works and returns the records I expect.
What am I doing wrong?
I'm trying to return all records in a query where the value of an integer is a null value. When I simply put "Is Null" in the criteria box, the query works. The problem is I need to include an IIF statement as criteria, like so:
IIf(GetValue("variable") <> 0, GetValue("variable"), Is Null)
GetValue is a function I use in VBA to return the value of a global variable, in this case "variable". The function returns a variant. So if the value of "variable" is 0, I want to return all records where the value of the field is NULL. However, when I try to employ this strategy, the query returns NO records. Like I said, if I just put "Is Null" in the criteria, it works and returns the records I expect.
What am I doing wrong?