I have the following code to check if the instracutor had the same course before or not:
Dim strCriteria As String
If Not IsNull(Me.cboprogram_name) Then
strCriteria = _
"Instructor_id = " & Me.txtInstructor_id & _
" And program_name = " & Me.cboprogram_name & _
" And CourseID <> " & Me.txtCourseID
If DCount("*", "InstructorCoursetbl", strCriteria) > 0 Then
MsgBox " Course Already Registered for this Instructor", vbExclamation, "Invalid Operation"
Above code is located on the event of cboprogram_name beforeupdate event but I got the following error msg:
Run-time error 3075 syntax error (missing operator) in query expression 'Instructor_ID= And Program_name=2 And CourseID<>58'
Any help please?