You can create a dialog box by creating a form and setting certain properties to make the form function like a dialog box.
- Create a form and add the controls you want on the dialog box to the form.
- Open the form in Design view (Design view: A view that shows the design of these database objects: tables, queries, forms, reports, and macros. In Design view, you can create new database objects and modify the design of existing objects.).
- Double-click the form selector (form selector: The box where the rulers meet, in the upper-left corner of a form in Design view. Use the box to perform form-level operations, such as selecting the form.) to open the property sheet (property sheet: A pane that is used to view or modify the properties of various objects such as tables, queries, fields, forms, reports, data access pages, and controls.).
- In the Pop Up property box, click Yes.
- In the Modal property box, click Yes.
- In the BorderStyle property box, click Dialog.
- In the RecordSelectors property box, click No.
- In the NavigationButtons property box, click No.
- In the DividingLines property box, click No.
- Create a macro or an event procedure to open the dialog box.
- Attach the macro or an event procedure to the form 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.
To position a dialog box on the screen, open it in Design view, maximize the Microsoft Access window, position the window where you want it, and then save the form. The dialog box will appear in this location when it is opened (assuming the AutoCenter property is set to No and you haven't specified its position in the event procedure that opens the dialog box).