Note If closing a module in the Visual Basic Editor (VBE), you must use acModule in the objecttype argument.

ObjectName Optional Variant. A string expression that's the valid name of an object of the type selected by the objecttype argument.

Remarks

For more information on how the action and its arguments work, see the action topic.

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:

A form in Form view or Datasheet view.

A report in Print Preview.

A module.

A data access page in Page view.

A server view in Datasheet view or Print Preview.

A table in Datasheet view or Print Preview.

A query in Datasheet view or Print Preview.

A stored procedure in Datasheet view or Print Preview.

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.