ACC2000: Event Procedure Disappears When a Control Is Renamed (209087)
The information in this article applies to:
This article was previously published under Q209087 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SYMPTOMS
Event procedure code does not run when you expect it to.
CAUSE
You changed the Name property of the control that has the event procedure code. When you change a control's name by changing its Name property, the event procedure code name, which is made up of the control name and the event name, does not change to reflect the new control name.
This behavior is consistent with Microsoft Visual Basic's intended design.
RESOLUTION
To restore the original event procedure, do either of the following:
- Copy the code from the original event procedure, and then paste it into the new event procedure.
-or-
- Delete the new event procedure code, including the beginning Sub and
ending End Sub lines, and then rename the original event procedure to
the correct name for the control.
REFERENCESFor more information about creating event procedures, click Microsoft Access Help on the
Help menu, type event properties in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned.
Modification Type: | Major | Last Reviewed: | 6/30/2004 |
---|
Keywords: | kbprb kbusage KB209087 |
---|
|