DLookup - What am I doing wrong?

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
 
T

Tom Lake

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top