Disable system error messages

cbsull

New member
Local time
Today, 07:46
Joined
Feb 21, 2006
Messages
8
Is there a way to disable the automatic error messages that occur when a user:
1. enters a letter in a number field
2. enters a date in the wrong format (should be MM/DD/YY and they enter MM//DD/YY, etc.)
3. clicks on a button that will open a hyperlink (Currently a message pops up to make sure the user wants to follow the link, by selecting "Yes" the hyperlink opens.)

I would like to add in my own error messages for the above errors but I don't know how to disable the system generated error messages.

Thanks!
 
In the code that produces your error yo should have code something like this
(surrounding the code)

On Error GoTo Err_Youraction_Click

'your code here'

Exit_Youraction_Click:
Exit Sub

Err_Youraction_Click:
MsgBox Err.Description
Resume Exit_Youraction_Click

when an error occurs it will display an error number make a not of it(ie 2046)

Replace the above code below Err_Youraction_Click: with

If Err.Number = 2046 Then
Resume Next 'do what you want to do'
Else
MsgBox Err.Number & vbCrLf & Err.Description
Resume Exit_Youraction_Click
End If
 

Users who are viewing this thread

Back
Top Bottom