Microsoft KB Archive/156198

= ACC: Procedure Name Ctl* Does Not Match Control Name =

Article ID: 156198

Article Last Modified on 7/1/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q156198



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
When you create a control on a form that starts with a numeric character, and you then add an event procedure to that control, Microsoft Access will attach the characters "Ctl" (without the quotations marks) to the name of the procedure.



CAUSE
Microsoft Access does not allow a procedure name to begin with a numeric character; therefore, it automatically changes the procedure name to something that is valid.



RESOLUTION
Use the guidelines for naming Visual Basic procedures (or Access Basic procedures in Microsoft Access version 2.0) when you create controls that may be used in event procedures.



MORE INFORMATION
Microsoft Access has a different naming convention for Visual Basic (or Access Basic) procedures than it has for controls on forms. Procedure names must begin with a letter. Control names can start with a number and still be valid. However, if a control name starts with a number, and you add an event procedure to that control, Microsoft Access will attach the characters "Ctl" (without the quotations marks) to the name of the procedure.

Steps to Reproduce Behavior

 * 1) Create a form not based on any table or query.
 * 2) Set the Name property of the control to 1Name.
 * 3) Create an event procedure for the control. Note that Microsoft Access changes the name to Ctl1Name.

Keywords: kbprb kbusage KB156198

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.