Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

The Updated event does not fire for some controls in Microsoft Access 2007


View products that this article applies to.

Symptoms

In Microsoft Access 2007 when you use the Updated event of an ActiveX control inserted on a Microsoft Access form, that event will not fire.

↑ Back to the top


Cause

Microsoft is aware of this problem in Access 2007.

↑ Back to the top


Resolution

To work around this issue, choose one of the following methods:

Method 1

Use the Change event. 

The On Change event may not appear in the Property Sheet of the ActiveX control. However, you can implement the Change event for the control by editing the VBA code for the control. For example:

1. Open the Visual Basic Editor (Alt+F11)

2. On the Microsoft Access form where the control resides, create a Change event for the control with the following code stub:

Private Sub SpinButton0_Change()

End Sub

3. Copy the existing code from the Updated event to the Change event.

If you prefer, you can rename the Updated event to Change event. In the form's code locate the following line:

Private Sub SpinButton0_Updated(Code as Integer)

Change the line to:

Private Sub SpinButton0_Change()

Method 2

Use a different version of Microsoft Office Access. The problem does not occur in other versions, such as Access 2010 or Access 2003.

Method 3

Use a different control. Not all controls have an On Updated event. There may be another control available that performs a similar function but uses different events, such as the Before Update or After Update events.

↑ Back to the top


More information

The form controls native to Microsoft Office Access do not include an On Updated event. The ActiveX controls, Microsoft Forms 2.0 SpinButton and Microsoft Forms 2.0 TabStrip, are two controls that include the Updated event and experience this issue in Access 2007. You may also experience this issue with other external or third-party controls, such as those available from the Insert ActiveX Control menu. 

If a name of a macro appears in the On Updated event in the Property sheet for the ActiveX control, you may need to convert the Updated event to the Change event in VBA. For instance, if "Macro1" appears in the On Updated event, open the form in design view and then open the VBA window for the form. Create the following procedure in the VBA for the Access form where the control resides:

Private Sub SpinButton0_Change()
    DoCmd.RunMacro "Macro1"
End Sub

If you see "On Change" on the Events tab of the Property Sheet of your control, you can simply move the macro name from the On Updated event to the On Change event and will not need to create any VBA code.

↑ Back to the top


Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

↑ Back to the top


Keywords: KB2447624

↑ Back to the top

Article Info
Article ID : 2447624
Revision : 2
Created on : 11/1/2010
Published on : 11/1/2010
Exists online : False
Views : 344