ACC: Procedure Name Ctl* Doesn't Match Control Name

Last reviewed: June 8, 1997
Article ID: Q156198
The information in this article applies to:
  • Microsoft Access versions 2.0, 7.0

SYMPTOMS

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

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 : FmrOthr FmsEvnt kbusage
Version : 2.0 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.