Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to stop error messages when running action querys.

Status
Not open for further replies.

kgreen

Technical User
Sep 11, 2000
32
GB
I am calling an action query, that moves records from one table to another, from a buttons OnClick event.

The query works fine but Access being Access throws up the standard error message.

I know that there is a way the the messages can be turned off while the query runs but I have forgotten how its done.

I am using the following:

DoComd.OpenQuery "QueryName"

Any help or suggestions

Kenny. [sig][/sig]
 
Try This
Docmd.SetWarnings False
Docmd.OpenQuery "QueryName"
Docmd.SEtWarnings True
 
Hi Keith,

Thanks for your reply but I forgot to mention that I already had the SetWarnings on and off lines in my code.

The thing I am looking for I think is something like

db.execute "Queryname"

But there is some other stuff that goes before it that stops the warning messages.

Thanks again,

Kenny [sig][/sig]
 
Kenny,

This used to bug me too.

You need to set the application options in code. Put the following code in the On Open event of your first from.

Application.SetOption "Confirm Record Changes", False
Application.SetOption "Confirm Action Queries", False


WP [sig]<p>Bill Paton<br><a href=mailto:william.paton@ubsw.com>william.paton@ubsw.com</a><br><a href= [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top