DLookup

rothjm

Registered User.
Local time
Yesterday, 19:53
Joined
Jun 3, 2003
Messages
46
I need a DLookup with multiple criteria.
When I do the IP_01 criteria by itself, it works fine. When I try to add another criteria (IP_02), I get a type mismatch error.
Can someone spot the syntax error of my code?
TIA

code:
varNextIP = DLookup("[IP_04]", _
"tblNet", _
"[IP_01] = " & intIP1 And _
"[IP_02] = " & intIP2)
 
In case anyone comes across this in future searches:

Something like this:
varNextIP = DLookup("[IP_04]", _
"tblNet", _
"[IP_01] = " & intIP1 _
& " And [IP_02] = " & intIP2 _
& " And [IP_03] = " & intIP3)
 

Users who are viewing this thread

Back
Top Bottom