Carmen
Registered User.
- Local time
- Today, 20:42
- 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!
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!