Closing Queries automatically saves them

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
 
J

Jerry Whittle

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.
 
A

Andy

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
 
G

ghetto_banjo

at some point you turned off the warnings and you never turned them
back on. check all your macros / vba
 
J

Jerry Whittle

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.
 
R

RonaldoOneNil

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.
 
J

John W. Vinson

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top