PRB: OLE Event Procedure Listed Under "General" in Object Box

    Article ID: Q132021
    Creation Date: 26-JUN-1995
    Revision Date: 05-FEB-1996

    The information in this article applies to:

    • Microsoft Access Developer's Toolkit version 2.0

    SYMPTOMS

    Novice: Requires knowledge of the user interface on single-user computers.

    In the Module window, when you use the Object box to display an OLE control event procedure, the name of the custom control is listed in the Object box under "general" rather than under the name of the custom control.

    CAUSE

    The OLE control Name property has too many characters.

    STATUS

    This behavior no longer occurs in Microsoft Access for Windows 95 version 7.0.

    RESOLUTION

    Limit the Name property of custom controls to 20 or fewer characters.

    NOTE: You can copy and paste the code that you created for the truncated custom control's event procedure from the "general" section to the new custom control.

    MORE INFORMATION

    When Microsoft Access creates event procedures, it combines the name of the control and the event procedure, separated by the underscore character. If the control name is longer than 20 characters, Microsoft Access truncates the control name portion of the Sub declaration to 20 characters.

    The situation occurs only if you use the short-cut method (click the object, click the right mouse button, and then click Build Event) to open the Module window.

    Microsoft Access initially creates the event procedure using the full name of the control. If the control name is longer than 20 characters, Microsoft Access truncates the control, creating a new event procedure. Microsoft Access places the original event procedure under "general" in the Object box. Any code entered in the event procedure is contained in the event procedure in the "general" section. The new, truncated event procedure is empty.

    Steps to Reproduce Behavior

    1. Create a new form and insert a custom control.
    2. Set the custom control's Name property to "testtesttesttesttesttest" (without the quotation marks).
    3. Click the custom control, click the right mouse button to display the shortcut menu, and then click Build Event.
    4. Enter any valid Access Basic statement. Note that the custom control's event procedure is listed under "general" in the Object box.


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.
©1997 Microsoft Corporation. All rights reserved. Legal Notices.

Additional reference words: 2.00
KBCategory: kbusage
KBSubcategory: FmsOthr