This event does not occur when a value changes in a calculated control. To run the AfterUpdate macro or event procedure without running the Exit and LostFocus macros or event procedures, save the record by using the Save Record command on the Records menu.īeforeUpdate macros and event procedures run only if you change the data in a control. When you move to a different record, the Exit and LostFocus events for the control occur, followed by the Current event for the record that you moved to, and the Enter and GotFocus events for the first control in this record. When you enter new or changed data in a control on a form and then move to another record, or save the record by clicking Save Record on the Records menu, the AfterUpdate event for the form occurs immediately after the AfterUpdate event for the control. When the focus leaves the record, or if the user clicks Save Record on the Records menu, the entire record is updated, and the data is saved in the database. Within a record, changed data in each control is updated when the control loses the focus or when the user presses Enter or Tab. The BeforeUpdate event is triggered when a control or record is updated. It applies only to the option group itself. This event does not apply to option buttons, check boxes, or toggle buttons in an option group. To run a macro or event procedure when this event occurs, set the BeforeUpdate property to the name of the macro or to. However, if you then move to another record or save the record, the form's BeforeUpdate event does occur. Setting the Cancel argument to True (1) cancels the BeforeUpdate event.Ĭhanging data in a control by using Visual Basic or a macro containing the SetValue action doesn't trigger these events for the control. The setting determines if the BeforeUpdate event occurs. SyntaxĮxpression A variable that represents a Form object. The BeforeUpdate event occurs before changed data in a control or record is updated.