You can use the AccessError method to return the descriptive string associated with a Microsoft Access error or an ADO error.
Syntax
[application.]AccessError(errornumber)
The AccessError method has the following arguments.
Argument | Description |
---|---|
application | Optional. The Application object. |
errornumber | The number of the error for which you wish to return a descriptive string. |
Remarks
You can use the AccessError method to return the descriptive string associated with a Microsoft Access error or an ADO error when the error hasn't actually occurred.
You can use the Visual Basic Raise method to raise a Visual Basic error. Once you've raised the error, you can determine its associated descriptive string by reading the Description property of the Err object.
You can't use the Raise method to raise a Microsoft Access error or an ADO error. However, you can use the AccessError method to return the descriptive string associated with these errors, without having to generate the error.
You can use the AccessError method to return a descriptive string from within a form's Error event.
If the Microsoft Access error has occurred, you can return the descriptive string by using either the AccessError method or the Description property of the Visual Basic Err object.