You can use the Close action to close either a specified Microsoft Access window or the active window if none is specified.
The Close action uses the following arguments.
Action argument | Description |
Object Type | The type of object whose window you want to close. Click Table, Query, Form, Report, Macro, or Module in the drop-down list in the Action Arguments section of the Macro window. To select the active window, leave this argument blank. |
Object Name | The name of the object to be closed. The Object Name box shows all objects in the database of the type selected with the Object Type argument. Click the object to close. If you left the Object Type box blank, leave this box blank also. |
Save | Whether to save changes to the object when its closed. You can click Yes to save the object, No to close the object without saving it, and Prompt to prompt the user whether or not to save the object. The default is Prompt. |
The Close action works on all database objects that the user can explicitly open or close. This action has the same effect as selecting an object and then closing it by clicking Close on the File menu, clicking Close on the Control menu for the objects window, or clicking the Close button for the object.
If the Save argument is set to Prompt and the object hasnt already been saved before the Close action is carried out, a dialog box prompts the user to save the object before the macro closes it. If youve set the Warnings On argument of the SetWarnings action to No, the dialog box isnt displayed and the object is automatically saved.
To run the Close action in Visual Basic, use the Close method of the DoCmd object.
Close Method; Event Properties; Open, Close Events; Quit Action.