Occurs only as the result of a data access error that takes place when no Visual Basic code is being executed.
Syntax
object_Error([Index As Integer,] ByVal ErrorNumber As Long, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, fCancelDisplay As Boolean)
The Error event syntax has these parts:
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
Index | Identifies the control if it's in a control array. |
ErrorNumber | The native error number. |
Description | Describes the error. |
Scode | Error code returned by the server. |
Source | Source of the error. |
HelpFile | The path to a Help file containing more information on the error. |
HelpContext | The Help topic context number. |
fCancelDisplay | A boolean value that can be set to cancel the error display, as shown in Settings. |
Settings
The settings for fCancelDisplay are:
Constant | Value | Description |
False | 0 | Continue. |
True | -1 | (Default) Display the error message. |
Remarks
The Error event will occur whenever an error not caused by Visual Basic halts an operation. Errors can fall into two categories: errors generated by the ADO, and general errors (for example, an out of memory error). In cases where the source is ADO, the ADO Data Control may add contextual text to the description string.