I have a main form and a subform to it.
There is a command button in the main form for 'Exit without saving'. Some of the fields in the main form and subform is in required fields.
Here is the code I have so far:
Private Sub Command31_Click()
Code:
If MsgBox("Are you sure you want to exit without saving?", vbQuestion + vbYesNo, "Delete Record") = vbNo Then Exit Sub
Me.Undo
DoCmd.Close
DoCmd.OpenForm FormName:="fdlgSearch"
End Sub
The code works perfectly fine if I have started answering some questions in the main form only but it did not work when I start to answer questions in the subform and when I try to save and exit.
It tells me that I need to answer some fields before I exit. How do I get the subform to be working?
Please help.
Thanks in advance