Cancel button on data entry form

  • Thread starter Thread starter Jovalle
  • Start date Start date
J

Jovalle

Guest
I added Cancel button using Undo command on data entry form but getting an error message ("undo action isn't available now"). How do I fix this problem?
 
Undo only works on a bound form and I believe it only works BEFORE the record is saved.
 
Try to use the Begintrans, Committrans and Rollback function to undo operation even after hundreds raws of commands or records; I found them very useful.
Hope this helps you, S.
 
Pat is correct, to my knowledge, you must do this before the record is actually saved. But it is very simple. Using a cmdButton named cmdCancel, here is all it takes:

Private Sub cmdCancel_Click()
Me.Undo
End Sub

Now if the record has been saved, you will need different code to delete record.

Good Luck,
RDH

[This message has been edited by R. Hicks (edited 04-12-2000).]
 

Users who are viewing this thread

Back
Top Bottom