Enter, Exit Events - Event Procedures

Enter, Exit Events — Event Procedures

See Also         Example

To create an event procedure that runs when the Enter or Exit event occurs, set the OnEnter or OnExit property to [Event Procedure], and click the Build button .

Syntax

Private Sub controlname_Enter( )

Private Sub controlname_Exit(Cancel As Integer)

The Enter event procedure has the following argument.

Argument Description
controlname The name of the control whose Enter event procedure you want to run.

The Exit event procedure has the following arguments.

Argument Description
controlname The name of the control whose Exit event procedure you want to run.
Cancel The setting determines if the Exit event occurs. Setting the Cancel argument to True (–1) cancels the Exit event

Remarks

You can't cancel the Enter event.