Errors

D

Daniel

When I delete a record using DoCmd.RunSQL and I want to
suppress the Access delete MsgBox, how do I do that? On
the click event there is no Response parameter to use
acDataErrContinue.

Also, when trapping errors, how far does on go to do
that? That is to say, when I have a DoCmd.OpenForm on a
click event, there is no real need to do an error handler,
right?

Should I put something in every forms Form_Error event?
and if so, what sort of thing does one enter?

Thanks

Daniel
 
A

Allen Browne

To avoid the message:
DoCmd.SetWarnings False
Don't forget to turn it on again afterwards.
Alternatively use the Execute method instead of RunSQL:
dbEngine(0)(0).Execute strSQL, dbFailOnError

The answer to your question about error handling depends on who is using
your app. If it's you, and you don't mind dropping into the VBE window and
seeing the code, then don't worry too much. At the other extreme, if you
plan to release an MDE or runtime application, make sure you use error
handling in every 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

Top