Access Forces me to Save Query

N

NAJ

Hi, I've looked through previous posts but not found the solution to
this little problem: In some Access Databases I've been using, I'm
forced to save Ad-hoc queries. (which i then save with a random name
and then delete them) Its really rather annoying, but it doesn't
always happen. Can anyone give me a clue as to why it happens? To
clarify, I create the query, and then once I've finished with it, I
close the query. The "Save / Don't Save / Cancel" box comes along, but
it won't let me choose don't save. I can cancel of course but then i'm
back where i started.
Any clues?
Cheers,
NAJ
 
M

Mike D.

If you create a NEW query, you'll have to save it if you
want to use it in the future. However, if you're in a
form or table and make you're "ad-hoc" query from Row
Source (for example), you can exit the query without
saving it to a name. You would be using this QUERY
BUILDER to basically create an automatic SQL statement.

Mike D.
 
A

Anne Nolan

Hi NAJ,

This will happen if you have turned off the SetWarnings flag. One way to
turn them back on is to open the Immediate window (type Ctrl-G) and put
the following bit of code in that window:

DoCmd.SetWarnings True

Put your cursor on the line at the end, and hit your Enter key.. this will
execute that line of code, and turn your warnings back on. Then you'll
get the normal message box when you close your ad-hoc query.

Anne
 
Joined
May 11, 2012
Messages
2
Reaction score
0
Anne, thanks for the info. I had the same problem and couldn't figure why.

I ran earlier automated actions which was setting the warning on, and the action failed.

Thanks to you I can go back to my code and make sure I have the docmd.setwarning true back in the Exit function: section! LOL

Well done.
 

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