Q: determining current "Show Warnings" state

  • Thread starter Thread starter A C
  • Start date Start date
A

A C

Hi

Is there a way to determine Access's current "Show Warnings" state? I would
like to turn warnings off, run my code, then restore the warnings back to
what they were prior to me running the code.

Thanks in advance
A
 
I'm not sure how to check the current state, but there may be another way
around this. Instead of using DoCmd.RunSQL, try the Execute command instead.
It will run without any prompting prior to running. Add the dbFailOnError
argument to handle errors should they occur.

Examples:
CurrentDb.QueryDefs("MyQuery").Execute dbFailOnError
or
qdf.Execute dbFailOnError
or
strSQL = "UPDATE ....;"
CurrentDb.Execute strSQL, dbFailOnError
 
Back
Top