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

ID: Q153312


The information in this article applies to:


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 
Issue type        : kbbug 

Last Reviewed: April 29, 1999