You can use the Quit action to exit Microsoft Access. The Quit action can also specify one of several options for saving database objects prior to exiting Microsoft Access.
The Quit action uses the following argument.
Action argument |
Description |
Options |
Specifies what happens to unsaved objects when you quit Microsoft Access. Click Prompt to display dialog boxes that ask whether to save each object. Click Save All to save all objects without prompting by dialog boxes. Click Exit to quit without saving any objects. The default is Save All. |
Microsoft Access doesn’t run any actions that follow the Quit action in a macro.
You can use this action to quit Microsoft Access without prompts from Save dialog boxes by using a custom menu command or a button on a form. For example, you might have a master form that you use to display the objects in your custom workspace. This form could have a Quit button that runs a macro containing the Quit action with the Options argument set to Save All.
This action has the same effect as choosing the Exit command from the File menu. If you have any unsaved objects when you choose this command, the dialog boxes that appear are the same as those displayed when you select Prompt for the Options argument of the Quit action.
You can use the Save action in a macro to save a specified object without having to quit Microsoft Access or close the object.
To run the Quit action in Visual Basic, use the Quit method of the DoCmd object.
Close Action, Quit Method (DoCmd Object), StopAllMacros Action, StopMacro Action.