Modal Property

Applies To

Form.

Description

You can use the Modal property to specify whether a form opens as a modal form. When a form opens as a modal form, you must close the form before you can move the focus to another object.

Setting

The Modal property uses the following settings.

Setting

Description

Visual Basic

Yes

The form opens as a modal form in Form view.

True (-1)

No

(Default) The form isn’t a modal form when it opens.

False (0)


You can set this property using the form’s property sheet, a macro, or Visual Basic.

Remarks

When you open a modal form, other windows are disabled until you close it. To disable menus and toolbars in addition to other windows, set both the form’s Modal and PopUp properties to Yes.

You can use the BorderStyle property to specify the kind of border for a form. Typically, modal forms have the BorderStyle property set to Dialog.

Tip You can use the Modal, PopUp and BorderStyle properties to create a custom dialog box. You can set Modal to Yes, PopUp to Yes and BorderStyle to Dialog for custom dialog boxes.

Setting the Modal property to Yes makes the form modal only when you open it in Form view from the Database window or using a macro or Visual Basic. When the form is modal, you can’t switch to other views of the form from Form view. You must close the form and reopen it in Design view or Datasheet view.

Note You can use the Dialog setting of the Window Mode argument of the OpenForm action to open a form with its Modal and PopUp properties set to Yes.

See Also

BorderStyle Property, ControlBox Property, MinMaxButtons Property, OpenForm Action, PopUp Property.