MsgBox Interferes with Undo

Jason1971

Registered User.
Local time
Today, 13:38
Joined
Jan 19, 2009
Messages
46
Hi,

In the code below, the Undo cmd is not working. It seems to be too near the MsgBox procedure. How can I end/close the MsgBox AND THEN perform the Undo? Thanks in Advance.

Code:
Private Sub Form_Dirty(Cancel As Integer)
        
         MsgBox ("Message Here")
         Me.Undo
            
End Sub
 
Whenever code is ran, the capability to undo anything prior is erased. I believe this is what applies here as well?
 
It isn't the message box that is causing you problems. It is the inappropriate use of the event.

Explain more fully what it is you really want to happen so we can figure out where to put the code.
 
Hmm.. my mistake then.. I know in excel I am unable to undo anything after I run any code. I assumed it would be the same here.. I will have to do a bit more research into that then. Thanks for the correction.
 
Hi Bob,

Thank you for your comments. I'm really stuck on this one and I was hoping you would help. My problem is described in the thread "VBA Undo Command not Undoing" by me a couple of days ago. I'm still trying to solve the problem. Your comments would be most helpful. Thank you. (User VBAInet has provided some helpful advice and I am still working through their ideas). If you could reply in the "VBA Undo Command not Undoing" post I will catch it. Thanks once again.
Jason.
http://www.access-programmers.co.uk/forums/showthread.php?p=925784
 
Last edited:

Users who are viewing this thread

Back
Top Bottom