DLookup - What am I doing wrong?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have a form/subform. On the main form I pull from tblClients.

I have an InChargeStaff field in tblClients that contains a number, which
correlates to the ID field in tblStaff. I want to show the staff name on the
form. tblStaff contains the columns: ID, First, Last, FullName.

=DLookUp("[FullName]","[tblStaff]","[tblClients]![InChargeStaff]"="[tblStaff]![ID]")

I get no error message, just nothing in the box. I'm sure it's something
simple I've forgotten. TIA
 
Karin said:
Hi, I have a form/subform. On the main form I pull from tblClients.

I have an InChargeStaff field in tblClients that contains a number, which
correlates to the ID field in tblStaff. I want to show the staff name on
the
form. tblStaff contains the columns: ID, First, Last, FullName.

=DLookUp("[FullName]","[tblStaff]","[tblClients]![InChargeStaff]"="[tblStaff]![ID]")

I get no error message, just nothing in the box. I'm sure it's something
simple I've forgotten. TIA

If ID is a numeric field, do this:

=DLookUp("[FullName]","[tblStaff]","[tblClients]![InChargeStaff] = " &
[tblStaff]![ID])

if it's a text field, do this:

=DLookUp("[FullName]","[tblStaff]","[tblClients]![InChargeStaff] = '" &
[tblStaff]![ID] & "'")

Tom Lake
 
Back
Top