Suppress Run-time errors!

  • Thread starter Thread starter Vince
  • Start date Start date
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
 
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
 
Back
Top