Hi guys, I'm new to Access here!
I've got 4 tables, Students, Courses, Course_Section and Registration.
I've created a form based off Registration and am trying to get the details (Last_Name, First_Name, etc.) found in table "Students" to autofill when I key in the "Students" primary key, Student_ID.
This is what I have:
Autofill works, but I keep getting 'You must enter a value in the 'Students.Last_Name' field', and I've no idea why.Option Compare Database
Private Sub Student_ID_AfterUpdate()
PopulateFields
End Sub
Private Sub PopulateFields()
[Last Name] = DLookup("[Last Name]", "Students", "Student_ID = " & Me.Student_ID)
[First Name] = DLookup("[First Name]", "Students", "Student_ID = " & Me.Student_ID)
[Email Address] = DLookup("[Email Address]", "Students", "Student_ID = " & Me.Student_ID)
[Telephone] = DLookup("[Telephone]", "Students", "Student_ID = " & Me.Student_ID)
End Sub
Much thanks!