J
Julie
I have a form set up for data entry. I want to have a cancel button on the
form that will close the form without saving any data, should the user decide
that's what needs to happen.
Right now, I have this:
Private Sub Cancel_Click()
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.OpenForm "Switchboard", acNormal, "", "", , acWindowNormal
DoCmd.Close acForm, "EnterNewParticipant"
End Sub
This works if the user has started entering data. However, if the user
enters the form, doesn't type anything, and clicks the cancel button, I get
an error "The command or action 'Undo' isn't available now." What do I have
to do to avoid the error but still achieve the results I'm getting above?
form that will close the form without saving any data, should the user decide
that's what needs to happen.
Right now, I have this:
Private Sub Cancel_Click()
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.OpenForm "Switchboard", acNormal, "", "", , acWindowNormal
DoCmd.Close acForm, "EnterNewParticipant"
End Sub
This works if the user has started entering data. However, if the user
enters the form, doesn't type anything, and clicks the cancel button, I get
an error "The command or action 'Undo' isn't available now." What do I have
to do to avoid the error but still achieve the results I'm getting above?