Save Method

Save Method

See Also         Example         Applies To

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

Syntax

DoCmd.Save [objecttype, objectname]

The Save method has the following arguments.

Argument Description
objecttype One of the following intrinsic constants:
  acDataAccessPage
acDefault
(default)
acDiagram
acForm

acMacro
acModule
acQuery
acReport
acServerView
acStoredProcedure
acTable
  Note   If closing a module in the Visual Basic Editor (VBE), you must use acModule in the objecttype argument.
objectname A string expression that's the valid name of an object of the type selected by the objecttype argument.

Remarks

If you leave the objecttype and objectname arguments blank (the default constant, acDefault, is assumed for the objecttype argument), Microsoft Access saves the active object. If you leave the objecttype argument blank, but enter a name in the objectname argument, Microsoft Access saves the active object with the specified name. If you enter an object type in the objecttype argument, you must enter an existing object's name in the objectname argument.

If you leave the objecttype argument blank, but enter a name in the objectname argument, you must include the objecttype argument's comma.

Note   You can't use the Save method to save any of the following with a new name:

The Save method, whether it's run in the current database or in a library database, always saves the specified object or the active object in the database in which the object was created.