UpdateRecord Method

       

Saves the current values of bound controls.  Doesn't support named arguments.

Syntax

object.UpdateRecord

The object placeholder represents an object expression that evaluates to an object in the Applies To list.

Remarks

Use this method to save the current contents of bound controls to the database during the Validate event without triggering the Validate event again. Using this method avoids creating a cascading event.

The UpdateRecord method has the same effect as executing the Edit method, changing a field, and then executing the Update method, except that no events occur.

You can use this method to avoid triggering the Validate event.

Whenever you attempt to update a record in the database, any validation rules must be satisfied before the record is written to the database. These rules are established by setting the ValidationRule property or, in the case of Microsoft SQL Server, by Transact SQL defaults, rules, and triggers written to enforce referential and data integrity.

In some cases, the update may not occur because the operation violates referential integrity constraints, the page containing the record is locked, the database or Recordset object isn't updatable, or the user doesn't have permission to perform the operation. Any of these conditions generates a trappable error.