Warnings in Access

  • Thread starter Thread starter colmkav
  • Start date Start date
C

colmkav

Anyone know how to check whether warnings property is on or off? eg
after you make calls such as DoCmd.SetWarnings = False etc?
 
There is no built-in way to determine this.

You could achieve it replacing every use of SetWarnings with a call to your
own function that toggles SetWarnings and records its state in a public
variable:
Public bSetWarningState As Boolean
Public Function SetTheWarnings(bIsOn As Boolean)
DoCmd.SetWarnings bIsOn
bSetWarningState = bIsOn
End Function
You can then test bSetWarningState if you need to.

Before you go to that trouble, consider whether this is an adequate
approach. If you turn SetWarnings off, you have no idea whether your action
queries succeed, fail, or partially succeed and partially fail.

For a much more powerful solution, see this new article:
Action queries: suppressing dialogs, while knowing results
at:
http://allenbrowne.com/ser-60.html
 

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