Get Error Message Method
The Get Error Message method returns the error message that corresponds to an error code. If it does not find an error message that matches the error code, then it returns a null string (""). For more information, see Error Code and Error Text for Siebel VB Errors.
Format
Error[$] [(errornumber)]
For information about the dollar sign, see Usage of the Dollar Sign.
The following table describes the arguments that you can use with this method.
Argument | Description |
---|---|
errornumber |
An integer in the range of 1 through 32,767 that identifies an error code. If you do not include this argument, then Siebel VB returns the error message of the run-time error that occurred most recently. |
Example
The following example uses the Err statement to print the error number and the text of the error. If an error occurs during an attempt to open a file, then it uses the Error$ statement:
Sub Button_Click
Dim msgtext, userfile
On Error GoTo Debugger
msgtext = "Enter the filename to use:"
userfile = "c:\temp\trace.txt"
Open userfile For Input As #1
' ....etc....
Close #1
done:
Exit Sub
Debugger:
msgtext = "Error " & Err & ": " & Error$
Resume done
End Sub