Create a custom dialog box
- Create the form. The form can have any combination of controls.
- In form Design view, double-click the form selector to open the property sheet for the form.
- In the PopUp property box, click Yes.
- In the Modal property box, click Yes.
- In the BorderStyle property box, click Dialog. If you select the Dialog setting, the form has a thick border and can include only a title bar and a Control menu. The form can't be maximized, minimized, or resized.
- Create a macro or event procedure that opens the form.
- Attach the macro or event procedure to a form or report by specifying the macro name or event procedure as the setting for the appropriate event property. For example, type the name of the macro or event procedure in the OnClick property box of a command button.
Notes
- A custom dialog box usually contains one or more command buttons that run macros or event procedures that use the information entered in the dialog box to perform other actions. These buttons are often named OK and Cancel. You can control which button has the focus and which button will work as the Cancel button by setting the Default and Cancel properties for these types of command buttons. For more information about the Default property, click . For more information about the Cancel property, click .
- To position a custom dialog box on the screen, open the form in Design view, maximize the Microsoft Access window, position the dialog box where you want it, and then save the form. The dialog box will appear in this location when it's opened (assuming the AutoCenter property is set to No).
- For information about other properties that you might want to set for a custom dialog box, click .
- For information about creating a custom dialog box that prompts you to enter report criteria, click .
- For information about creating a query that gets its criteria from a custom dialog box in a Microsoft Access database (.mdb), click . For information about creating a stored procedure that gets its criteria from a custom dialog box in a Microsoft Access project (.adp), click .
- If you want to use the form as a normal form as well as a dialog box, you can use the Dialog setting of the OpenForm action to open the form temporarily as a dialog box instead of using this procedure. For more information, click .