warning trapping

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

Guest

Hello,

I am trying to figure out how to determine a system warning message's
number. I have 3 append quires and only want to display the system warning
only if the quires can not add the records due to key violations in the
table. I know that I can "set warnings false" before runing the quires, but
that turns off all the system warnings even the ones that I want to be
displayed.

Or should I be looking to capture the system warnings that I don't want to
have appear?

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeletePreAgents", acViewNormal, acEdit
DoCmd.OpenQuery "qryDeletePreHeader", acViewNormal, acEdit
DoCmd.OpenQuery "qryDeletePreParticipants", acViewNormal, acEdit
DoCmd.SetWarnings True

Any and all help is appreciated.



The code that I am working with is:
 
Hello,

I am trying to figure out how to determine a system warning message's
number. I have 3 append quires and only want to display the system warning
only if the quires can not add the records due to key violations in the
table. I know that I can "set warnings false" before runing the quires, but
that turns off all the system warnings even the ones that I want to be
displayed.

Or should I be looking to capture the system warnings that I don't want to
have appear?

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeletePreAgents", acViewNormal, acEdit
DoCmd.OpenQuery "qryDeletePreHeader", acViewNormal, acEdit
DoCmd.OpenQuery "qryDeletePreParticipants", acViewNormal, acEdit
DoCmd.SetWarnings True

Any and all help is appreciated.

The code that I am working with is:

Try the Execute method.

CurrentDb.Execute "qryDeletePreAgents",dbFailOnError
CurrentDb.Execute "qryDeletePreHeader",dbFailOnError
CurrentDb.Execute "qryDeletePreParticipants",dbFailOnError
 

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