DoCmd.Save (Access)

The Save method carries out the Save action in Visual Basic.

The Save method works on all database objects that the user can explicitly open and save. The specified object must be open for the Save method to have any effect on the object. 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, 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.

Save (ObjectType, ObjectName)


DoCmd.Save acForm, "New Employees Form"

Arguments

Optional arguments

The following arguments are optional

ObjectType (AcObjectType) - An AcObjectType constant that specifies the type of object that you want to save.

Here you can find possible values for AcObjectType

ObjectName (String) - A string expression that's the valid name of an object of the type selected by the ObjectType argument.