Changes to form design saved automatically after running Macro

annemu

Registered User.
Local time
Today, 14:54
Joined
Nov 10, 2008
Messages
16
I have Access 2003. I noticed recently that after I ran certain macros within the project that I have created, any changes to form design, query design, code, table design are saved automatically, without a confirmation message popping up. Or I can only do "save as" . :confused:
Most annoying, as I cannot reverse my changes. I have to completely shut down Access to stop this behaviour, but it reoccurs next time I run a Macro.
Has anyone encountered this problem before? Any fixes?
I have done the "Detect and Repair" but no luck.
 
Have you used this anywhere:

DoCmd.SetWarnings False

that will create the behavior you have described if you either fail to set it back to True or if it errors out at any time before you can set it back to true.
 
Cheers Bob,
I have a macro in which I have Set Warnings to "Off". Perhaps this causes the same problems? I will try it without that part of the macro. I have not noticed this in earlier editions of Access. Is it a relatively new fault?
 
Cheers Bob,
I have a macro in which I have Set Warnings to "Off". Perhaps this causes the same problems? I will try it without that part of the macro. I have not noticed this in earlier editions of Access. Is it a relatively new fault?

It isn't a fault. It has existed basically forever. But, what happens is that in Macros, normally the reset happens automatically (from what I've been told). But in code you have to set it back manually when using it. In a macro, if your code errors out at all before it finishes the macro, it will not reset like it should. So, I woudn't use it in macros and instead use it in VBA code which then can have an error handler and that can have the line:

DoCmd.SetWarnings True

as the first line in the error handler. Then you are pretty much assured of a reset should an error occur and it not get to the reset code in the normal function or sub.

If you are using Access 2007, you can handle the error in a macro and you can set that reset as the first line in it.
 
Oh, and to get your warnings back, just go into the VBA window, go to the immediate window and type

DoCmd.SetWarnings True

and hit enter. That will reset them manually.
 

Users who are viewing this thread

Back
Top Bottom