Save Method

Applies To

DoCmd Object.

Description

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 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


Remarks

If you leave the objecttype and objectname arguments blank, 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.

The Save method, whether it is executed 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.

See Also

Close Method, CopyObject Method, DoCmd Object, Quit Method, Quit Method (DoCmd Object), Rename Method, Save Action, TransferDatabase Method.

Example

This example uses the Save method to save the active object (a form) with the new name “New Employees Form”.


DoCmd.Save , "New Employees Form"