Activate, Deactivate Events

Applies To

Form, Report.

Description

These events occur:

  • Activate — When a form or report receives the focus and becomes the active window.
  • Deactivate — When a form or report loses the focus to a Table, Query, Form, Report, Macro, or Module window, or to the Database window.

Note The Deactivate event doesn’t occur when a form or report loses the focus to a dialog box, to a form for which the PopUp property is set to Yes, or to a window in another application.

Remarks

You can make a form or report active by opening it, clicking it or a control on it, or by using the SetFocus method in Visual Basic (for forms only).

The Activate event can occur only when a form or report is visible.

The Activate event occurs before the GotFocus event; the Deactivate event occurs after the LostFocus event.

When you switch between two open forms, the Deactivate event occurs for the form being switched from, and the Activate event occurs for the form being switched to. If the forms contain no visible, enabled controls, the LostFocus event occurs for the first form before the Deactivate event, and the GotFocus event occurs for the second form after the Activate event.

When you first open a form, the following events occur in this order:

Open Load Resize Activate Current

When you close a form, the following events occur in this order:

Unload Deactivate Close

When you close a report, the following events occur in this order:

Unload Close Deactivate

See Also

Current Event; GotFocus, LostFocus Events; GoToRecord Action; Load, Unload Events; Open, Close Events; Resize Event; SetFocus Method.