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
 
Top