Evening All,
I have a form with the following event codes:-
Private Sub Form_Current()
DoCmd.GoToRecord , , acFirst
End Sub
Private Sub close_Click()
DoCmd.SetWarnings False
MsgBox "Returning to Main Menu." & vbCrLf & vbCrLf & "Any details on this form will not be saved.", , " "
On Error Resume Next
DoCmd.RunCommand acCmdUndo
DoCmd.Close acForm, "FRM_create new", acSaveNo
DoCmd.OpenForm "FRM_MAIN MENU", acNormal, "", "", , acNormal
End Sub
If the form is set with the POP-UP and MODAL properties set to "no" and I have entered details on the form, scrolled the mouse wheel by mistake, then decide to use the "close_click" event, the record is not saved to the table...which is what I want it to do.
However, if the POP-UP and MODAL properties are set to "yes", then when I close the form the record saves to the table...which I DON'T want it to do!
What am I missing here???
Regards.
I have a form with the following event codes:-
Private Sub Form_Current()
DoCmd.GoToRecord , , acFirst
End Sub
Private Sub close_Click()
DoCmd.SetWarnings False
MsgBox "Returning to Main Menu." & vbCrLf & vbCrLf & "Any details on this form will not be saved.", , " "
On Error Resume Next
DoCmd.RunCommand acCmdUndo
DoCmd.Close acForm, "FRM_create new", acSaveNo
DoCmd.OpenForm "FRM_MAIN MENU", acNormal, "", "", , acNormal
End Sub
If the form is set with the POP-UP and MODAL properties set to "no" and I have entered details on the form, scrolled the mouse wheel by mistake, then decide to use the "close_click" event, the record is not saved to the table...which is what I want it to do.
However, if the POP-UP and MODAL properties are set to "yes", then when I close the form the record saves to the table...which I DON'T want it to do!
What am I missing here???
Regards.