Form frmInfo with a subform frmAppointment. I want to check to see that all appointments have a complete date before I allow the user to check complete on a check box on the main form. My code (which was written by someone else) is as follows. I am getting error 2001 you canceled the previous operation. I am unable to figure out why. The references are all correct. If anyone can see whats wrong and help me with it, it would be greatly appreciated.
	
							
						
					Code:
	Private Sub Complete_BeforeUpdate(Cancel As Integer)
Dim varIncompleteProject As Variant
   varIncompleteProject = (DLookup("[AppID]", "tblAppointment", _
   "[ConsultNumber]= """ & Me.ConsultNumber & _
   """ And[CompletedDate] Is Null"))
 If Not IsNull(varIncompleteProject) Then
    MsgBox "Appointment " & varIncompleteProject & " Is Not Competed"
    Cancel = True
 End If
End Sub
Comment