Update Method

The Update method on a Recordset object saves any changes you make to the current record of a Recordset object.

recordset.Update Fields, Values
 

Parameters

Fields
This optional parameter specifies a Variant representing a single name or a Variant array representing names or ordinal positions of the field or fields you wish to modify.
Values
This optional parameter specifies a Variant representing a single value or a Variant array representing values for the field or fields in the new record.

Remarks

The Update method is used to save any changes you make to the current record of a Recordset object since calling the AddNew method or since changing any field values in an existing record. The Recordset object must support updates for the Update method to be used successfully.

To set field values, do one of the following:

When arrays of fields and values are used, there must be an equal number of elements in both arrays. Also, the order of field names must match the order of field values. If the number and order of fields and values do not match, an error occurs.

If the Recordset object supports batch updating, then multiple changes to one or more records can be cached locally the UpdateBatch method is called. If you are editing the current record or adding a new record when the UpdateBatch method is called, ADO will automatically call the Update method to save any pending changes to the current record before transmitting the batched changes to the OLE DB Provider.

If you move from the record you are adding or editing before calling the Update method, ADO will automatically call Update to save the changes. The CancelUpdate method must be called if you want to cancel any changes made to the current record or to discard a newly added record.

The current record remains current after the Update method is called.