Edit access's message (1 Viewer)

ALAN

Registered User.
Local time
Today, 00:52
Joined
Jul 12, 2000
Messages
23
How to change this message with the message of my own "You tried to assign a Null Value to a variable that is not a variant data type."
 

AlanS

Registered User.
Local time
Yesterday, 19:52
Joined
Mar 23, 2001
Messages
292
You need to use error trapping, similar to the following code. Replace [whatever] with the actual error code number of the error you want a custom message for, and [your custom error message] with the actual message you want displayed.

On Error Goto Error_Label
'code that may generate error goes here
Done_Label:
Exit Sub
Error Label:
If Err.Number = [whatever] Then
Msgbox [your custom error message]
Else
Msgbox Err.Description
End If
Goto Done_Label
 
R

Rich

Guest
Isn't that assuming that it's a trappable error in the first place?
 

Users who are viewing this thread

Top Bottom