undo button

  • Thread starter enrico via AccessMonster.com
  • Start date
E

enrico via AccessMonster.com

my undo wizard button doesn't work, it only gives an alert message everytime
i click it something like:

"the command or action 'undo' isn't available right now".

is there a way or how can i code the cancel or undo button?
 
A

Allen Browne

Assuming a bound form where things can be editied, try this:

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

If that doesn't work, something else is going on.
 
L

Linq Adams via AccessMonster.com

The Wizard code for Undo throws this error when either the form is unbound or
the current record is already saved. Allen's code, unlike the Wizard's,
checks if the record is dirty before attempting to Undo it, and will
eliminate the error message. If the record has already been saved, which
sounds like the case here, Undo will have no effect.
 

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


Top