Undo Button

  • Thread starter Thread starter Heather
  • Start date Start date
H

Heather

Hello,

I have created an Undo button for my form withe th following code.

Private Sub cmdUndo_Click()
if Me.Dirty Then Me.Undo
End Sub

The problem is that it un-does everything that I changed and I do not want
it to do that- How can I undo one field at a time. Also I do not want the
undo button to become active unless I update something on the form and when I
leave to another record - I want the button to turn off untill again untill
updates are made.

Thanks!
 
Hi Heather,
one easy way is to forget about undo buttons.
Pressing the Esc key once will undo any edit to the current control.
Pressing it again will undo any edit to the current record.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
as an additional note: if the control you're in has *not* been edited, the
first Esc will undo all edits in the current record. also, you can't Undo
edits once the focus has moved off the current record - to another record,
into or out of a subform, or if the form is closed of course.

hth
 
Back
Top