Undo Button

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!
 
J

Jeanette Cunningham

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
 
T

tina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Cancel = True "variable not defined" 3
Clicking label makes Dirty property True 10
Undo Button Issue 2
Undo button 2
>> button has focus 4
Undo Command 4
Undo command 3
UNDO button 3

Top