Description
You can use the Close action to close either a specified Microsoft Access window or the active window if none is specified.
Setting
The Close action has 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 Object Type box 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 by the Object Type argument. Click the object to close. If you leave the Object Type argument blank, leave this argument blank also. |
Save | Whether to save changes to the object when it's closed. Click Yes (save the object), No (close the object without saving it), or Prompt (prompt the user whether or not to save the object). The default is Prompt. |
Remarks 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 object's window, or clicking the Close button for the object.
If the Save argument is set to Prompt and the object hasn't 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 you've set the Warnings On argument of the SetWarnings action to No, the dialog box isn't displayed and the object is automatically saved. To run the Close action in Visual Basic, use the Close method of the DoCmd object.See Also Close method, Open, Close events, Quit action.