Help in DLOOKUP Function

root2007

New member
Local time
Today, 07:27
Joined
Jan 25, 2012
Messages
9
Hi folks,

Can you please help with my dlookup function. I wrote this VB

txtPlateNo = DLookup("DesignatedTruck", "Driver Info", "DriverName = " & txtDriverName)

and the error is "syntax error (missing operator) in query expression"

What will I do?
 
Given that your matching on a string that string needs to be enclosed in quotes, try;
Code:
txtPlateNo = DLookup("DesignatedTruck", "Driver Info", "DriverName = [COLOR="Red"]'[/COLOR]" & txtDriverName [COLOR="Red"]& "'"[/COLOR])
 
... check this link for other types of criteria.
 

Users who are viewing this thread

Back
Top Bottom