DLookup Driving Me Nuts!

Carmen

Registered User.
Local time
Today, 15:37
Joined
Nov 30, 2001
Messages
58
Hello Everyone,
I have a main form, "Classes" with two subforms, "Enrollment" & "Attendance". Both subforms are linked to the main form by section ID. The Enrollment subform has an autonumber "EnrollID" and also a field for SSN. The Attendance subform also has an EnrollID field (to link to enrollment) and an unbound text box that I want to fill in with the SSN that matches the EnrollID. I'm trying to use DLookup in the control source of my unbound text box but it's not working:
=DLookUp("[SSN]","tblEnrollment","[EnrollID]=" & [Forms]![frmClasses]![frmEnrollmentSub]![EnrollID])

What is happening is that DLookup is filling in the SSN from the first record in all the records, even tho the EnrollID is different. It looks like it's just reading the first record and no others. Can anyone please help?
Thanks!
 
Rich,
Thanks for your reply. I thought of doing Attendance as a subform of Enrollment but I wasn't getting it to work the way I wanted. But you're right that makes the most sense. I'll try playing around with it again.
 

Users who are viewing this thread

Back
Top Bottom