Hi Everyone:
I have a form with a subform. If the user tries to close the form, without filling in the subform, I want a message to advise them of the empty subform. The problem is that when the user chooses to stay on the form, in answer to a message box, the following error pops up..."you canceled the previous operation". Can anyone help me to address this error and not have it pop up? The code on the unload event is:
Dim intResponse As Variant
If SubfrmAssessment_Details_Admission.Form.RecordsetClone.RecordCount = 0 Then
intResponse = MsgBox("Enter an Admission Assessment", vbYesNo, "Admission assessment is not done")
If intResponse = vbYes Then
DoCmd.CancelEvent
End If
End If
End Sub
Sophia
I have a form with a subform. If the user tries to close the form, without filling in the subform, I want a message to advise them of the empty subform. The problem is that when the user chooses to stay on the form, in answer to a message box, the following error pops up..."you canceled the previous operation". Can anyone help me to address this error and not have it pop up? The code on the unload event is:
Dim intResponse As Variant
If SubfrmAssessment_Details_Admission.Form.RecordsetClone.RecordCount = 0 Then
intResponse = MsgBox("Enter an Admission Assessment", vbYesNo, "Admission assessment is not done")
If intResponse = vbYes Then
DoCmd.CancelEvent
End If
End If
End Sub
Sophia