Solved

me.undo

Posted on 2002-03-04
4
434 Views
Last Modified: 2011-09-20
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
0
Comment
Question by:Paullkha
  • 2
4 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 6839228
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)
0
 
LVL 2

Author Comment

by:Paullkha
ID: 6839394
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.
0
 
LVL 1

Accepted Solution

by:
CareyMBilyeu earned 40 total points
ID: 6839449
but to answer your question:

The cmd button executes the following code:
me.undo
Me!cmdUndo.Enabled=False  

'***You might have to set focus back to the form and then
'to the control as well as move the focus to another
'control.


After executing this code, the cmd button should be disabled once again.

Where do I put this code?
Me.cmdUndo.Enabled = True
0
 
LVL 2

Author Comment

by:Paullkha
ID: 6839499
Focus?
damn, it works, didn't think I could do that.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now