CloseButton Property [Access 2003 VBA Language Reference]
Specifies whether the Close button on a form is enabled. Read/write Boolean.
expression.CloseButton
expression Required. An expression that returns one of the objects in the Applies To list.
Setting
The CloseButton property uses the following settings.
Setting | Visual Basic | Description |
---|---|---|
Yes | True | (Default) The Close button is enabled. |
No | False | The Close button is disabled and the Close command isn't available on the Control menu. |
You can set the CloseButton property by using the form's property sheet , a macro , or Visual Basic .
You can set the CloseButton property only in form Design view.
Remarks
If you set the CloseButton property to No, the Close button remains visible but appears dimmed (grayed), and you must provide some other way to close the form — for example, a command button or custom menu command that runs a macro or event procedure that closes the form.
Tip
You can also close the form by pressing ALT+F4.
Applies to | Form Object | Report Object
See Also | BorderStyle Property | ControlBox Property | MinMaxButtons Property