ACC2000: "Undefined Function in Expression" Error Message

ID: Q208884


The information in this article applies to:
  • Microsoft Access 2000

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

This article applies only to a Microsoft Access database (.mdb).


SYMPTOMS

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 the Microsoft products listed at the beginning of this article.


MORE INFORMATION

CAUTION: Following the steps in this example will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform these steps on a copy of the database.

Steps to Reproduce Problem

  1. Open the sample database Northwind.mdb.


  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:


  4. ControlSource: =Sum(Notwork())
  5. On the View menu, click Code.


  6. Type the following user-defined function in the report module:


  7. 
    Function Notwork()
       Notwork=8
    End function 
  8. Close the report module.


  9. Preview the report.

    Note that you receive the error message mentioned in the "Symptoms" section.



REFERENCES

For more information about creating modules, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type "creating modules" in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Additional query words: pra

Keywords : kberrmsg kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: May 18, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.