BeforeUpdate event

Occurs before data in a control is changed.

Syntax

Private Subobject _BeforeUpdate( ByValCancelAs MSForms.ReturnBoolean)

The BeforeUpdate event syntax has these parts:

Part Description
object Required. A valid object.
Cancel Required. Event status. False indicates that the control should handle the event (default). True cancels the update and indicates the application should handle the event.

Remarks

The BeforeUpdate event occurs regardless of whether the control is bound (that is, when the RowSource property specifies a data source for the control).

This event occurs before the AfterUpdate and Exit events for the control (and before the Enter event for the next control that receives focus).

If you set the Cancel argument to True, the focus remains on the control and neither the AfterUpdate event nor the Exit event occurs.

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.