TOPIO
asked on
Dlookup Query with two variables
I'm trying to do a Dlookup with two variables so that the record brought back from the
query qryAssignation will only be the records 1 to 8 in courseID and GroupID equal to value stored in the cbgroup Combo box but I do not seem to be able to get it to work.
query qryAssignation will only be the records 1 to 8 in courseID and GroupID equal to value stored in the cbgroup Combo box but I do not seem to be able to get it to work.
Private Sub cbGroup_AfterUpdate()
Dim i As Integer
'i get the error here
For i = 1 To 8
Me("lCourse" & i).Caption = Nz(DLookup("Course", "qryAssignation", (("CourseID=" & i) And "GroupID" = Me.cbGroup)))
Next
For i = 1 To 8
Me("lTeacher" & i).Caption = Nz(DLookup("Teacher", "tblteacher", "TeacherID=" & i))
Next
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
mx