ACC: "Undefined Function in Expression" Error Message

Last reviewed: May 21, 1997
Article ID: Q123344
The information in this article applies to:
  • Microsoft Access version 2.0, 7.0, 97

SYMPTOMS

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

When you call a user-defined function from within an aggregate (totals) function (such as the Sum() function) in a report, you may receive the following error message:

   Undefined function '<function name>' in expression.

CAUSE

The user-defined function is located in the report module.

RESOLUTION

Transfer the user-defined function from the report module to a global module.

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. Open the sample database Northwind.mdb (or NWIND.MDB in Microsoft Access 2.0).

  2. Open the Alphabetical List Of Products report in Design view.

  3. Add a text box with the following property to both the detail section and the Product Name footer section of the report:

          ControlSource: =Sum(Notwork())
    

  4. On the View menu, click Code.

  5. Enter the following user-defined function in the report module:

          Function Notwork()
    
             Notwork=8
          End function
    
    

  6. Close the report module.

  7. Preview the report. Note that you receive the error message described earlier in this article.

REFERENCES

For more information about creating modules, search for "module," and then "Creating" using the Microsoft Access 97 Help index.


Keywords : kberrmsg kbusage SynFnc
Version : 2.0 7.0 97
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbworkaround


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: May 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.