Link to home
Start Free TrialLog in
Avatar of Tom Crowfoot
Tom CrowfootFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<<
=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:
https://www.experts-exchange.com/Microsoft/Development/MS_Access/A_12-Dlookup-and-the-Domain-Functions.html
Avatar of Tom Crowfoot

ASKER

perfect - thank you for the swift response
Glad to help :)