Error, Error$ Functions |
No
Error[(errornumber)]
errornumber
Use: Optional
Data Type: Long
Any valid error code.
Error returns a variant of subtype string; Error$ returns a String. Both return values are standard descriptions for the particular error code.
Returns either the error description corresponding to the given error number or the description for the last error.
If errornumber isn't passed to the function, Error returns the description for the last error to have occurred. If no errors have occurred, a zero-length string ("") is returned.
If errornumber isn't recognized as a VB error, the function returns the description "Application-defined or object-defined error."
If errornumber is outside the range of a valid error code, an overflow error is generated.
x = Error(100)
The Error and Error$ functions are included for only backward compatibility. Instead, you should use the Description property of the Err object in all new code. The Error$ function, however, is useful for obtaining an error description for any error code "after the event," when perhaps the Err object has been reinitialized.