DoCmd Object.
The Close method carries out the Close action in Visual Basic. For more information on how the action and its arguments work, see the action topic.
DoCmd.Close [objecttype, objectname], [save]
The Close method uses the following arguments.
Argument |
Description |
objecttype |
One of the following intrinsic constants: acTable |
objectname |
A string expression that is the valid name of an object of the type selected with the objecttype argument. |
save |
One of the following intrinsic constants: acPrompt |
If you leave this argument blank, the default (acPrompt) is assumed. |
If you leave the objecttype and objectname arguments blank, Microsoft Access closes the active window. If you specify the save argument and leave the objecttype and objectname arguments blank, you must include the objecttype and objectname arguments’ commas.
Close Action; DoCmd Object; Open, Close Events; Quit Method (DoCmd Object); Save Method.
This example uses the Close method to close the form Order Review, saving any changes to the form without prompting.
DoCmd.Close acForm, "Order Review", acSaveYes