Link to home
Start Free TrialLog in
Avatar of Paullkha
PaullkhaFlag for United States of America

asked on

me.undo

I have a control on a form entitled Undo Changes. This control is disabled until this event is fired:

Private Sub Form_Dirty(Cancel As Integer)
    Me.cmdUndo.Enabled = True
End Sub

The cmd button executes the following code:
me.undo
After executing this code, the cmd button should be disabled once again.

Where do I put this code?
Me.cmdUndo.Enabled = True
Avatar of nico5038
nico5038
Flag of Netherlands image

Why disabling this control?

I normally code an [Undo] button like:

If me.dirty then
   me.undo
endif

and have it always enabled.
The user will know when he "screw up" the form...

Nic;o)
Avatar of Paullkha

ASKER

True. But in most applications, the behavior is undo button disabled until one has changed the doc. If one hits undo, the doc is cleaned and the undo button is again disabled. Trying to mimick this behavior but can not see how.
ASKER CERTIFIED SOLUTION
Avatar of CareyMBilyeu
CareyMBilyeu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Focus?
damn, it works, didn't think I could do that.