Programming Reference Manual
 
Syntax
 
Error ErrorCode
-or-
Error[$]([ErrorCode])
 
Description
Instruction: Signal error ErrorCode. This triggers error handling just like a real error. The current procedure's error handler is activated, unless it is already active or there isn't one. In that case the calling procedure's error handler is tried. (Use Err.Raise to provide complete error information.)
 
Function: The Error( ) function returns the error text string.
 
Parameter
Description
ErrorCode
This is the error number.
See Also
Example
 
Sub Main
On Error GoTo Problem
Err.Raise 1 ' simulate error #1
Exit Sub
 
Problem: ' error handler
Debug.Print "<span style='color: #004080; font-weight: bold;'>Error</span>$=";Error$
Resume Next
End Sub