I have a form "frmMainMenu" with menu items on it. When I click on an item, before opening a form the following code is executed to close open forms.
The problem I have is that if an entry has been made into a form, the record is saved. I don't want that as I have an explicit save on the form. Is there some way to close a form without saving the data when closing it from another form? I tried putting Me.Undo in the On Close event of the form being closed and that didn't work. I just need it not to save that record, either by putting something in the form or modifying the above code.
Code:
Dim frm as Form
For icount = 1 To Forms.Count + 1
For Each frm In Forms
If frm.Name <> "frmMainmenu" Then
DoCmd.Close acForm, frm.Name
End If
Next frm
Next icount
The problem I have is that if an entry has been made into a form, the record is saved. I don't want that as I have an explicit save on the form. Is there some way to close a form without saving the data when closing it from another form? I tried putting Me.Undo in the On Close event of the form being closed and that didn't work. I just need it not to save that record, either by putting something in the form or modifying the above code.