Don't want new record to post

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

I have a form to enter new records. I want a button on it so that if the user
wants to leave the form and cancel the update the form will close without
posting the record to the database. How do I keep the record from posting?
 
Hi Don,
assuming a form without any subforms, use an undo or cancel button.
The code is like this-->

Private Sub ButtonName_Click
If Me.Dirty Then
Me.Undo
End If
End Sub

You will need to remove the form's access close button (the x in top right
corner).

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top