[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

me.undo

Posted on 2002-03-04
4
Medium Priority
?
456 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 160 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

656 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