Updated Event — Event Procedures

Description

To create an event procedure that runs when the Updated event occurs, set the OnUpdated property to [Event Procedure], and click the Build button.

Syntax

Private Sub controlname_Updated(Code As Integer)

The Updated event procedure has the following arguments.

Argument

Description

controlname

The name of the control whose Updated event procedure you want to run.

Code

The setting indicates how the OLE object was updated. The Code argument can be one of the following intrinsic constants:

Constant

Description

acOLEChanged

Indicates that the object's data has changed.

acOLESaved

Indicates that the object's data has been saved by the application that created the object. This usually occurs when the user clicks the application's Update command or whatever command is used for updating.

acOLEClosed

Indicates that the file containing the object's data has been closed by the application that created the object.

acOLERenamed

Indicates that the file containing the object's data has been renamed by the application that created the object.


Remarks   To see if an object's data has been changed since it was last saved, set a public variable in the Updated event procedure indicating that the object needs to be saved. When you save the OLE object, reset the variable.

You can't cancel the Updated event.

See Also   Updated event — macros.