ACC: Event Procedure Disappears When a Control Is RenamedLast reviewed: May 28, 1997Article ID: Q113876 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. Event procedure code does not run when you expect it to.
CAUSEYou 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 behavior.
RESOLUTIONTo restore the original event procedure, do either of the following:
MORE INFORMATIONMicrosoft Access creates the name of the procedure in an event procedure using a combination of the control name and the event name. For example, the procedure name for an event procedure in the OnClick property of a command button control named MyButton might be MyButton_Click. The first line of the event procedure would be:
Sub MyButton_Click ()If you rename the button, the OnClick property will still have an associated event procedure, but the original event procedure will not be renamed accordingly. Instead, a new, empty event procedure will be called by the button's OnClick property. The MyButton_Click subprocedure is still a part of the form, however. To access it in the form's module, select General in the Object box on the module toolbar, and then select MyButton_Click in the Procedure box.
Steps to Reproduce Behavior
REFERENCESFor more information about creating event procedures, search the Help Index for "event procedures," or ask the Microsoft Access 97 Office Assistant. |
Keywords : FmsEvnt kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |