P
Paul James
I'm trying to use an expression as the criteria in a query field and I can't
understand why I'm getting a data type mismatch.
The field is a text field.
The expression I'm trying to use is:
IIf(DLookUp("Processed","tblFromToInvoiceAandP","FromToID = 1")=-1,Null,Is
not Null).
I know there's nothing wrong with the DLookUp function, because I've checked
it in the VBA Immediate Window. In addition, both Null and Is not Null work
just fine if I type either in by themselves. I know there's nothing wrong
with the IIf structure, because if I replace Null and Is not Null with
specific text values, there is no error and the query recordset returns the
records that have the criteria valuse.
So why am I getting a "data type mismatch" error when I put the Null/Is not
Null values in the IIf statement?
Thanks in advance,
Paul
understand why I'm getting a data type mismatch.
The field is a text field.
The expression I'm trying to use is:
IIf(DLookUp("Processed","tblFromToInvoiceAandP","FromToID = 1")=-1,Null,Is
not Null).
I know there's nothing wrong with the DLookUp function, because I've checked
it in the VBA Immediate Window. In addition, both Null and Is not Null work
just fine if I type either in by themselves. I know there's nothing wrong
with the IIf structure, because if I replace Null and Is not Null with
specific text values, there is no error and the query recordset returns the
records that have the criteria valuse.
So why am I getting a "data type mismatch" error when I put the Null/Is not
Null values in the IIf statement?
Thanks in advance,
Paul