Suppress Run-time errors!

V

Vince

Hi,

I would like to know if I can suppress harmless "Run-time
errors"?

If so where do I go in Access?

The error is "Run-Time error '2501': THe OpenForm action
was canceled......

it also gives option buttons namely DEBUG and END.

I think this will confuse users!

Please advise
 
S

Scott McDaniel

You should trap those errors and handle them as needed. There has been quite
a lot written about error handling, and a Google search will yield mountains
of information.

A traditional error handler looks something like this:

Sub ctlName_AfterUpdate()
On Error GoTo ProcErr

<<bunch of code here>>

Exit sub

ProcErr:
Select Case Err.Number
Case 2501
Resume Next
Case Else
MsgBox "Error: " & err.number & vbcrlf & vbcrlf &
err.description
End Select
End Sub
 

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