PRA: Expression Builder Starts When Code Builder Is Expected

    Article ID: Q138907
    Creation Date: 30-OCT-1995
    Revision Date: 16-DEC-1996

    The information in this article applies to:

    • Microsoft Access versions 2.0, 7.0, 97

    SYMPTOMS

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

    If a function that is defined in a form or report's global area is accessed from one of the form or report's event properties, clicking the Build button in the property sheet starts the Expression Builder instead of the Code Builder. If the function is defined in a module in the Database window, it starts the Code Builder.

    STATUS

    Microsoft has confirmed this to be a problem in Microsoft Access versions 2.0, 7.0, and 97. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

    MORE INFORMATION

    Steps to Reproduce Problem

    1. Create a new form.
    2. On the View menu, click Code.
    3. Type the following code in the module:

            Public Function MyFunctionOne()
                MsgBox "hi from MyFunctionOne"
            End Function
      

          NOTE: In version 2.0, omit the word "Public."
      
    4. Close the module, and then, on the View menu, click Properties.
    5. Set the form's OnCurrent property as follows:

            "=MyFunctionOne()"
      
    6. Click the Build button next to the OnCurrent property. Note that the Expression Builder comes up.
    7. Create a new module and type the following code:

            Public Function MyFunctionTwo()
                MsgBox "hi from MyfunctionTwo"
            End Function
      

      NOTE: In version 2.0, omit the word "Public."

    8. Close the module, and then set the form's OnCurrent property as follows:

            "=MyFunctionTwo()"
      
    9. Click the Build button next to the OnCurrent property. Note that the Code Builder comes up.

      Note that the different results are inconsistent. The expected result for step 6 is to open the Code Builder as step 9 does.


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.

KBCategory: kbusage
KBSubcategory: FmrCdbeh
Additional reference words: 2.00 7.00 97 8.00