Occurs when a control detects an error and cannot return the error information to a calling program.

Syntax

For MultiPage
Private Sub object_Error( index As Long, ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As SCode, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)

For other controls
Private Sub object_Error( ByVal Number As Integer, ByVal Description As MSForms.ReturnString, ByVal SCode As SCode, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, ByVal CancelDisplay As MSForms.ReturnBoolean)

The Error event syntax has these parts:

Part Description
object Required. A valid object name.
index Required. The index of the page in a MultiPage associated with this event.
Number Required. Specifies a unique value that the control uses to identify the error.
Description Required. A textual description of the error.
SCode Required. Specifies the for the error. The low-order 16 bits specify a value that is identical to the Number argument.
Source Required. The string that identifies the control which initiated the event.
HelpFile Required. Specifies a fully qualified path name for the Help file that describes the error.
HelpContext Required. Specifies the of the Help file topic that contains a description of the error.
CancelDisplay Required. Specifies whether to display the error string in a message box.

Remarks

The code written for the Error event determines how the control responds to the error condition.

The ability to handle error conditions varies from one application to another. The Error event is initiated when an error occurs that the application is not equipped to handle.