Closing Queries automatically saves them

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

I've noticed recently that when testing queries with filters, when i go to
close the query I am no longer prompted with the 'do you want to save' prompt.

Instead, the query just closes and saves my temporary filters. How can I
prevent this and get the prompt back please?
Thanks
 
Is this happening in quereis with filters or even changes to forms and
reports? Open up a report and make a very minor change, such as moving a
label a little. Close it without saving. Do you get a prompt?

If not, someone has turned Set Warnings off in a macro or code, but forgot
to turn Set Warnings back on. People often do this for things like action
queries so that the users don't get bothered with the "You are about to "
messages.

In code it would look like so:
DoCmd.SetWarnings False

If not prompted for saving after any changes, you need to find where set
warnings is turned off and either comment out that line or add a set warnings
on towards the end of the function or macro.
 
Yeah, I was aware of the set warning function as I use this at the start/end
of my macros. However this is just going into a query design view and not
running it through VBA
 
at some point you turned off the warnings and you never turned them
back on. check all your macros / vba
 
Maybe something in your startup form or an autoexec macro is tripping set
warnings. Open the database while holding down the Shift key. Then
immediately do something with a query to see if the same behavior happens.
 
Open up any module and then press CTRL-G. In the immediate window at the
bottom, type in DoCmd.Setwarnings True
This will turn back on the prompts. Check all your code to make sure you
have matching setwarning commands to turn them on/off.
Maybe you had an error in code so that the turning back on never got executed.
 
Yeah, I was aware of the set warning function as I use this at the start/end
of my macros. However this is just going into a query design view and not
running it through VBA

If you have VBA or a macro that does Setwarnings False - and work for two
hours doing other things - it will still suppress warnings for *anything*.
That's the point. Setting Setwarnings False is a timebomb that you need to
either defuse or not set in the first place!
 
Back
Top