Focus events occur when a form or control loses or gains the focus, or a form or report becomes active or inactive.
Event | Event property | It occurs |
---|---|---|
Activate | OnActivate (forms, reports) | When a form or report becomes the active window. |
Deactivate | OnDeactivate (forms, reports) | When a different Microsoft Access window becomes the active window, but before the window becomes the active window. The Deactivate event does not occur when the focus moves to another application's window, a dialog box, or a pop-up form. |
Enter | OnEnter (controls) | Before a control actually receives the focus, either from a control on the same form or when the form opens. This event occurs before the GotFocus event. |
Exit | OnExit (controls) | Just before a control loses the focus to another control on the same form. This event occurs before the LostFocus event. |
GotFocus | OnGotFocus (forms, controls) | When a control, or a form with no active or enabled controls, receives the focus. A form can get the focus only if all visible controls on a form are disabled, or there are no controls on the form. |
LostFocus | OnLostFocus (forms, controls) | When a form or control loses the focus. A form can have the focus only if all visible controls on a form are disabled, or there are no controls on the form. |