Surpress warning messages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to surpress warning messages. For a production environment
there are in my view too many dialog boxes with warning messages requiring a
respone from the user.
 
I assume you're talking about the "You're about to add..." type messages
that occur when you use RunSQL or RunQuery to run SQL.

You can issue a DoCmd.SetWarning False before you run the SQL and then issue
a DoCmd.SetWarning True afterwards, or, better in my opinion, you can use
the Execute method of the Database or QueryDef object.

CurrentDb.Execute "INSERT INTO ...", dbFailOnError

CurrentDb.QueryDefs("MyQuery").Execute dbFailOnError

The advantage of using Execute is that when you supply the dbFailOnError
parameter, any errors can be trapped by your error handling routine.
 

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

Back
Top