Applies To: | Button | MsgBox |
Description
This property determines which of a set of push buttons in a Form, SubForm or MsgBox is the default button.
In a Form or SubForm, the Default Button will generate a Select event (30) when the user presses the Enter key, even though the Default Button may not have the focus at the time.
If however, the user explicitly shifts the focus to another Push Button, the automatic selection of the Default Button is disabled and the Enter key applies to the Button with the focus.
For a Button, the Default property has the value 1 or 0. As only one Button can be the Default Button, setting Default to 1 for a particular Button automatically sets Default to 0 for all others with the same parent.
In a MsgBox, Default specifies which button initially has the focus. It has the value 1, 2 or 3 corresponding to the three buttons that can be defined. See Btns property for further details.