Quit Method (DoCmd Object)

Applies To

DoCmd Object.

Description

The Quit method of the DoCmd object carries out the Quit action in Visual Basic. For more information on how the action and its arguments work, see the action topic.

Syntax

DoCmd.Quit [options]

The Quit method uses the following arguments.

Argument

Description

options

One of the following intrinsic constants:

acPrompt
acSaveYes
acSaveNo
acExit

If you leave this argument blank, the default (acSaveYes) is assumed.


Remarks

The Quit method of the DoCmd object was added to provide backwards compatibility for running the Quit action in Visual Basic code in Microsoft Access version 7.0. It is recommended that you use the existing Quit method of the Application object instead.

Example

This example displays a dialog box that asks if you want to save any changed objects before you quit Microsoft Access.


DoCmd.Quit acPrompt