Activate and Deactivate Events

Object List Next Object

Defined By:
Form

Description:

Activate occurs when a form becomes active.

Deactivate occurs on the active form immediately before a different form becomes active.

Usage:

Sub Activate ()
Sub Deactivate ()

Details:

A form can become active by user action or by code. For example, you can click on a form or use the Show or SetFocus methods in code to make it active.

The Activate event takes place before the GotFocus event. The Deactivate event takes place after the LostFocus event, and before the next GotFocus event. The Activate event can occur only when a form is both loaded and visible.

The Activate and Deactivate events are triggered only when you move the focus between forms in the same application. Moving the focus between the current form and a form in another application does not affect either event. Unloading a form also has no affect on the Deactivate event.

See Also:
GotFocus event, LostFocus event