Dlookup with two criteria syntax help

latex88

Registered User.
Local time
Today, 06:44
Joined
Jul 10, 2003
Messages
198
Hi,

I'm having a hard time figuring out the exact syntax for the below dlookup function. When I separate the criteria individually, I get a result, but when I combine the two, I get run-time error of Type Mismatch.

strTableID is a string variable

DLookup("ID", "MyTable", "myFieldName= '" & strTableID & "'" And "Status = 'Open' ")
 
Try this one:

DLookup("ID", "MyTable", "myFieldName= '" & strTableID & "' And Status = 'Open' ")
 
That worked great. Thanks.
 

Users who are viewing this thread

Back
Top Bottom