Save Action

Description

You can use the Save action to save either a specified Microsoft Access object or the active object if none is specified. You can also save the active object with a new name in some cases (this functions the same as the Save As command on the File menu).

Setting

The Save action has the following arguments.

Action argument

Description

Object Type

The type of object you want to save. Click Table, Query, Form, Report, Macro, or Module in the Object Type box in the Action Arguments section of the Macro window. To select the active object, leave this argument blank. If you select an object type in this argument, you must select an existing object's name in the Object Name argument.

Object Name

The name of the object to be saved. The Object Name box shows all objects in the database of the type selected by the Object Type argument. If you leave the Object Type argument blank, you can leave this argument blank to save the active object, or, in some cases, enter a new name in this argument to save the active object with this name.

If you enter a new name, the name must follow the standard naming conventions for Microsoft Access objects.


Remarks   The Save action works on all database objects that the user can explicitly open and save. The specified object must be open for the Save action to have any effect on the object. This action has the same effect as selecting an object and then saving it by clicking Save on the File menu, or clicking the Save button on the toolbar. Leaving the Object Type argument blank and entering a new name in the Object Name argument has the same effect as clicking Save As/Export on the File menu, and entering a new name for the active object. Using the Save action enables you to specify an object to save and to perform a Save As command from a macro.

Note You can't use the Save action 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.
The Save action, whether it's carried out in a macro 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.

If you save the active object with a new name, but the name is the same as the name of an existing object of this type, a dialog box asks if you want to overwrite the existing object. If you've set the Warnings On argument of the SetWarnings action to No, the dialog box isn't displayed and the old object is automatically overwritten.

To run the Save action in Visual Basic, use the Save method of the DoCmd object.

See Also   Close action, CopyObject action, Quit action, Rename action, Save method, TransferDatabase action.