ACC95: "Cannot Find Function" Error Msg Using Timer() in a Macro

Last reviewed: May 14, 1997
Article ID: Q153312
The information in this article applies to:
  • Microsoft Access version 7.0

SYMPTOMS

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

When you run a macro, you may receive the following error message:

   The expression you entered has a function name that Microsoft Access
   can't find.

CAUSE

The macro may contain a reference to the Timer() function. This reference can exist either in the condition column of the macro or in an argument of one of the macro actions.

RESOLUTION

Create the following Visual Basic for Applications function. This function will return the value of the Timer() function. Next, replace all references in your macro(s) with calls to this new function.

   Public Function MyTimer() As Single
      MyTimer = Timer()
   End Function

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version 7.0. This problem no longer occurs in Microsoft Access 97.

MORE INFORMATION

Steps to Reproduce Problem

  1. Open the sample database Northwind.mdb.

  2. Create a new macro with the following properties:

          Action: RunCode
          Function Name: Timer()
    

  3. Run the Macro. Note that you receive the error message described in the "Symptoms" section.

REFERENCES

For more information about converting macros to Visual Basic for Applications, search on the phrase "How do I convert my macro to code," and then view "Convert Macros to Visual Basic for Applications" using the Answer Wizard from the Microsoft Access for Windows 95 Help menu.


Keywords : kbusage McrProb
Version : 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbbug
Resolution Type : kbfix


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