when i close a query, Access is saving it without prompting

G

Guest

Hi, hoping someone can help here - Im working with a database that for some
reason, has started to save changes to queries without prompting. It only
happens with this particular database . So when i close a query, it never
asks me if i want to save my changes -

Any ideas how to switch this off?

Thanks

Craig
 
G

Guest

could be that someWhere in the code you running docmd.setwarnings False.
Unless you are not running the application, you just open it in design.
 
G

Guest

I have fixed the problem now thankyou - it was because i have a macro
running a make table query and i had set the "setwarnings" part to no. I
thought using this would only apply to that particular query, not the whole
database!
 
G

Guest

You can use the setwarnings false just don't forget to change it after that
to set the warnings to true.
Another thing you can chane the option in access, so it wont prompt you with
messages when you operate action queries, but it will prompt you when you
change a design to the query
go to tools , options , search and edit, mark the action query to no, that
way you wont have to use the setwarnins to false
Have a nice weekend
 
D

Douglas J Steele

As you've found, SetWarnings is an all-or-nothing proposition.

For this reason, I prefer to use the Execute method of either the Database
or QueryDef objects: it doesn't generate the prompts.

Rather than:

DoCmd.RunSQL strSQL

it's

CurrentDb().Execute strSQL, dbFailOnError

The use of the dbFailOnError option means that you can trap any errors that
might be raised.
 

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