DLookup across tables

P

Pat Dools

Hello,

I will be entering Attendance records and would like to find the Health
Center that the Subject is associated with and populate the 'Health Center'
text box on the Attendance form. Is DLookup the best way to accomplish this?
I do not need to store the 'Health Center' on the Attendance record, I just
need it to auto-populate once the Subject is chosen (AfterUpdate).

Here is the SQL to demonstrate how these tables link to each other:

SELECT tSubject_LU.Subject_ID, tSubject_LU!Subject_LName+",
"+tSubject_LU!Subject_FName AS Subject_Name, tHealthCtr_LU.HeatlhCtr_Name
FROM tHealthCtr_LU INNER JOIN (tSubject_LU INNER JOIN tAttendance_Tracking
ON tSubject_LU.Subject_ID = tAttendance_Tracking.Subject_ID) ON
tHealthCtr_LU.HealthCtr_ID = tSubject_LU.HealthCtr_ID;
 

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