How to suppress DoCmd.RunSQL messages?

G

Gijs

I'm using DoCmd.RunSQL to run Action Queries.

Before the SQL is executed, Access displays a message asking permission
to add/update a record to the table. Does anyone know how to suppress
this message?

Thanks in anticipation of your feedback.

Gijs
 
D

Douglas J. Steele

You can run DoCmd.SetWarnings False before the RunSQL (just make sure you
run DoCmd.SetWarnings True afterwards)

Better, though, is to use the Execute method of the database object (or of
the QueryDef object if you've saved the query). In addition to not having
the messages, it allows you to specify dbFailOnError to trap problems.
 
G

Gijs

Sorry guys ... I just found the answer

DoCmd.SetWarnings Off

thanks anyway

cheers,

Gij
 

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