• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 664
  • Last Modified:

dlookup help Access

Dear Experts,

For the life of me I can't get this dlookup to work

=DLookUp("[Gen-FirstName]","[Main]","[EmployeeID]= '" & [EmployeeID] & "'")

I've tried various different methods, but all fail

=DLookUp("[Gen-FirstName]","Main","[EmployeeID]= '" & [Me].[EmployeeID] & "'")

Gen-FirstName is the field I want returned from the table "Main"

The link is EmployeeID (Autonumber in Main) & a long interger number in the table behind the form I'm using (Table = "HR Log")

Can anybody help
  • 3
1 Solution
Try it like this:

=DLookUp("[Gen-FirstName]","[Main]","[EmployeeID]= " & [EmployeeID])

Open in new window

(The single quote delimiters should only be used for text fields - EmployeeID is numeric, so it should not be delimited)
=DLookUp("[Gen-FirstName]","[Main]","[EmployeeID]= " & [EmployeeID])


Also, make sure you are using the name of the table and field you're looking this up in (not the name of the form and textbox)

>> I'm using (Table = "HR Log")

If your table's name is HR Log, you would use that in the DLookup:

=DLookUp("[Gen-FirstName]","[HR Log]","[EmployeeID]= " & [EmployeeID]) 

Open in new window

Jim Dettman's article explains this stuff very thoroughly:
correlateAuthor Commented:
perfect - thank you for the swift response
Glad to help :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now