Annoying error message when nothing to "undo"

1jet

Registered User.
Local time
Tomorrow, 06:13
Joined
Sep 15, 2008
Messages
117
Hi all,

I've got a macro that has the following 3 actions.

1. SetWarnings = No (to turn off the annoying messages in the first place)
2. RunCommand = Undo
3. SetWarnings = Yes (to turn annoying messages back to default)

When there is nothing to "undo" on my form, there is the annoying message.

Anyone have a solution?

Thanks
 
Im guessing here but:

In design view right click and press build on your undo button, this will open the VB thing. Look for your undo cmd (it should take you to it). Now just delete the thing that says "MsgBox Err.Description" save, then try undo and see what happens.
 
thanks soulium.....i've managed to edit the vb code after converting
but its no longer a macro...but a module in access...im guessing thats what's supposed to happen.....

so how do i execute this module when i click the "undo" button?

i swear i saw a "runmodule" action in macros before having installed access 2007
 
Sorry, do you want to use the macro? Or do you just want to use the VB?
(not played with Access 2007 so you might need to search a bit as it could of all changed, this is what you do on 2003)

The easiest thing to do is just create an undo cmd button using the wizard via tools in design view (this is because it saves time writing code) also call you cmd something that will be easy to find on the vb code e.g. "cmdUndo", then right click the button and go to "build event" and take out the msgbox then the annoying msg wont appear.


Matt
 
Last edited:
yeah the thing is...after i "build event" and change the code...it's no longer a macro
it turns into a module

the problem now is i dont know how to execute a module in access regardless of the version :(
 
what about running the macro from the module?

you do that by building the event again and at the start of the event put in

DoCmd.RunMacro "MacroNameHere"
 
i suppose i could run the macro from the module if i need to
but the issue is still executing the module from my "cmdUndo" button on the form
 
Sorry am a bit slow today. Right!. Go to your button- right click "properties" - event - go down to "on click" click the "..." and select macro builder - you can then build up your desired macro. If that still bring the annoying msg up then delete the button and create a button using the wizard and then use the run macro cmd in the event and take out the msg box and you should be ok. The "OnClick" connects the button to the module when you use the code builder.
 
Last edited:
lol not enough coffee?

sorry to bother u with such n00b questions

but.....ive been able to click the "..." at "onClick" for the button
ive also been able to put in the vb code in the vb code builder

but now....how do i "save" the damn thing?
 
No worries mate, we all start somewhere (i've had coffe now - in a BIG mug :cool:)

Do you want it to save when you undo or do you want a save buton?
 
lol me also
ill have the button to just "undo" any action when i click on it

(the button is on the form of my "edit employee" form
ive found that i dont need any macros to "save" any changes as theyre done automatically when i close the form)
 
Cool :)

Well if you do want to put a save button in you can either use the wizard and select Save or you can make a button and put in the "on click" event - DoCmd.Save AcForm "FormNameHere" - which works aswell.
 

Users who are viewing this thread

Back
Top Bottom