I have a main form named NEWAddProducts with a subform on it name NEWAddProductsSub. I want to make changes on the subform but NOT have it save them. I can use this code for the subform and it works if I ONLY open the subform, if I open the main form as I would normally with the subform on it then the code does not work. Is there a way to make this code execute on the main form? I select a Category on the main form then choose a product(s) on the sub and the qty.
Private Sub Form_Close()
Dim Answer As String
If Me.Dirty = False Then
Answer = MsgBox("Do you want save changes?", vbQuestion + vbYesNo, "Confrim")
Select Case Answer
Case vbYes
DoCmd.RunCommand acCmdSaveRecord
Case vbNo
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End Select
Else
DoCmd.RunCommand acCmdClose
End If
End Sub