"Jen" <(E-Mail Removed)> wrote in message
news:82F1AFD8-9439-462A-9894-(E-Mail Removed)
> Okay I used this function many times and it works every other place
> but this one path will not work...
>
> Main table is = TblEmployess [TEEmployeeID] [TELastName]
>
> Table receiving information is = TblLogInSheet [TblEmployeeID] "I
> should
> have named it [TEEmployeeID]
>
> Now I want to look the last name up when I enter the Employee ID I
> tried =DLookUp("[TblEmployeeID]","[TblLogInSheet]","[TEEmployeeID]="
> & [TELastName])
You seem to be asking for records where TEEmployeeID, which I would
guess doesn't contain names, is equal to an employee's last name. Also,
your DLookup expression is looking up an EmployeeID given a last name,
but that's not what you said you wanted; you said you want to look up a
last name, given an Employee ID. If what you said is what you want,
then this would be more like it:
=DLookUp("TELastName","TblEmployees",
"TEEmployeeID=" & [TblEmployeeID])
That says, "look in TblEmployees for the record that has TEEmployeeID
equal to [TblEmployeeID], and return the value of TELastName for that
record. Is that what you want?
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)