i have a form where the user has already enter there student details...
they then move onto the next form where they re-enter the student id and the other details appear in the 3 text boxes below..
the problem im encountering is that the Dlookup only seems to return values for the first record and even if it is on record 30
the code i used is below, can someone tell me where i have gone wrong or is there a better way
cheers once more
si
they then move onto the next form where they re-enter the student id and the other details appear in the 3 text boxes below..
the problem im encountering is that the Dlookup only seems to return values for the first record and even if it is on record 30
the code i used is below, can someone tell me where i have gone wrong or is there a better way
Code:
Private Sub StudentID_afterupdate() 'searches student table to ensure name is correct
Dim name As Variant
Dim surname As Variant
Dim degree As Variant
name = DLookup("[First Name]", "student table", "[StudentID] = '" & StudentID & "'")
surname = DLookup("[Surname]", "student table", "[StudentID] = '" & StudentID & "'")
degree = DLookup("[Degree Programme]", "student table", "[StudentID] = '" & StudentID & "'")
Text35 = name
Text37 = surname
Text39 = degree
End Sub
cheers once more
si