DlookUp

BenSteckler

Addicted to Programming
Local time
Today, 13:43
Joined
Oct 4, 2000
Messages
44
I am having a Problem with a Dlookup.
The Help says to use this set up

Varx = DLookup("[LastName]", "Employees", "[EmployeeID] = 1")

Where [LastName] is the field to look up, "Employees" is the Table or Query and "[EmployeeID] = 1" is the critieria to meet.

Here is my problem and I can not get it to work. The criteria result is a value assigned to a variable earlier in the Module. I can not So my Criteria would be something like "[EmployeeID] = " VarABC, Where VarABC = 123.

Are there any Ideas? :-(
 
Change

Varx = DLookup("[LastName]", "Employees", "[EmployeeID] = 1")

to

Varx = DLookup("[LastName]", "Employees", "[EmployeeID] = " & VarABC)

That ought to do it
HTH
Chris
 
It worked perfectly.
smile.gif
 

Users who are viewing this thread

Back
Top Bottom