Can a run-time error message be suppressed?

  • Thread starter Thread starter Guest
  • Start date Start date
scubadiver said:
If "yes", how?

Add error handling to your code routine and in the error trap test for the error
number. Do nothing for the numbers you want to ignore.

Sub SomeSub

On Error GoTo ErrHandler

(code)

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case x, y, x
'ignore
Case Else
MsgBox Err.Description
End Select
Resume Egress
End Sub
 
Private Sub Act_ProcNF2_Enter()

On Error GoTo ErrHandler

Me.Act_ProcNF2 = ""

ErrHandler:
Select Case Err.Number
Case -2147352567
'ignore
Case Else
MsgBox Err.Description
End Select

End Sub

"Act_ProcNF2" is a textfield that doesn't allow zero-string entries. I am
trying to make sure the default value in this text field (which is "N/A") be
deleted but it isn't happening. I now realise the error won't get suppressed
even if the message does.

So my question didn't help.
 

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