Microsoft KB Archive/304098

= ACC2000: Custom Function Called by a Query Runs Multiple Times on a Computer Running Windows 2000 SP1 =

Article ID: 304098

Article Last Modified on 7/13/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q304098



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

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



SYMPTOMS
When you call a custom function from the criteria of a query, the function runs multiple times when it should run only one time.



CAUSE
This problem is caused by a bug in the Microsoft Jet database engine 4.0 that is included with Microsoft Windows 2000 SP1.



RESOLUTION
This problem has been fixed in the latest edition of the Jet Service Pack. For additional information about how to obtain the latest version of the Jet 4.0 database engine, click the following article number to view the article in the Microsoft Knowledge Base:

239114 How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine

NOTE: Always test updates thoroughly in a test environment before you distribute the update to your production environment.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This problem has been fixed in the latest edition of the Jet Service Pack.



Steps to Reproduce the Behavior
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.

 Install Windows 2000 SP1. Open the Northwind sample database. In the Database window, click Modules under Objects, and then click New.  Create the following function: Function Test Debug.Print &quot;Testing the Function.&quot; End Function  Save the module.</li>  Create the following query and name it CustomersTest: <pre class="fixed_text">  Query: CustomersTest Type: Select Query

Field: CustomerID Table: Customers

Field: CompanyName Table: Customers

Field: ContactName Table: Customers Criteria: =Test </li> Run the CustomersTest query.</li> Open the module that you created in step 3 in Design view.</li> On the View menu, click Immediate Window. Note that &quot;Testing the Function&quot; appears multiple times in the Immediate window. It should appear only appear one time.</li></ol>

Additional query words: netshow pra function query Jet multiple prb

Keywords: kbprb KB304098

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.