How to suppress DoCmd.RunSQL messages?

  • Thread starter Thread starter Gijs
  • Start date Start date
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
 
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.
 
Back
Top