Microsoft KB Archive/208884

= ACC2000: "Undefined Function in Expression" Error Message =

Article ID: 208884

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q208884





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 ' ' 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 that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

Steps to Reproduce Problem
 Open the sample database Northwind.mdb. Open the Alphabetical List Of Products report in Design view. 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)

 On the View menu, click Code.</li>  Type the following user-defined function in the report module: Function Notwork Notwork=8 End function </li> Close the report module.</li> Preview the report.

Note that you receive the error message mentioned in the "Symptoms" section.</li></ol>

<div class="references_section">