olivetwist
07-15-2015, 11:25 AM
I have a form that the user enters info in to submit requests which alerts us by email when a new entry is saved. I am adding a button to Close the form without saving the entry. It is a bound form so I have to clear the form prior to closing or it will add a new record. The "me.undo" code clears the form but for some reason I get this error on the "docmd.close" portion.
Private Sub CloseForm_Click()
On Error GoTo CloseForm_Click_Err
Me.Undo
DoCmd.Close acForm, [Request Form], acSaveNo
CloseForm_Click_Exit:
Exit Sub
CloseForm_Click_Err:
MsgBox Error$
Resume CloseForm_Click_Exit
End Sub
Private Sub CloseForm_Click()
On Error GoTo CloseForm_Click_Err
Me.Undo
DoCmd.Close acForm, [Request Form], acSaveNo
CloseForm_Click_Exit:
Exit Sub
CloseForm_Click_Err:
MsgBox Error$
Resume CloseForm_Click_Exit
End Sub