I have a form with a few combo boxes that also contains a subform with several other combo/text boxes. I added a "Cancel" button that should close the form without saving any changes made by the user. The problem is, it only works on the main form objects and not the subform objects. It will undo the changes to the combo boxes on the main form itself, but it will keep the changes made to the combo/text boxes on the subform. Here is the code I have for the button:
Private Sub cmdCancel_Click()
On Error GoTo Err_cmdCancel_Click
Me.Undo
DoCmd.Close
Exit_cmdCancel_Click:
Exit Sub
Err_cmdCancel_Click:
MsgBox err.Description
Resume Exit_cmdCancel_Click
End Sub
What else do I add to include the subform? Please help! Thank you!!!