Solved

me.undo

Posted on 2002-03-04
4
439 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 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