ACC2: TimerInterval Property Limited to 65,535 Milliseconds

Last reviewed: May 7, 1997
Article ID: Q124390
The information in this article applies to:
  • Microsoft Access version 2.0

SYMPTOMS

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

In Microsoft Access version 1.x or 2.0, setting a form's TimerInterval property to a value greater than 65,535 milliseconds (about 1 minute, 5 seconds) generates the following error message:

   Invalid setting for TimerInterval property; correct values are from
   0 to 65,535 milliseconds.

NOTE: In Microsoft Access for Windows 95 version 7.0, the maximum interval is 2,147,483,647 (about 24 days, 20 hours, 31 minutes, 24 seconds).

RESOLUTION

If you need to run code in intervals greater than 1 minute, set the TimerInterval property to 60,000 to execute the Timer event in intervals of 1 minute. In the Timer event, increment a static counter variable to count the number of minutes expired. When the counter reaches the interval you want to use, reset the counter and run the code.

STATUS

This behavior no longer occurs in Microsoft Access version 7.0.

MORE INFORMATION

The following example demonstrates how to create a form that will display a message box every 5 minutes:

  1. Create a new, blank form. Set the following property for the form:

          TimerInterval: 60000
    

  2. Set the form's OnTimer property to the following event procedure:

          Sub Form_Timer ()
             Const MAXMINUTES = 5
             Static iCount As Integer
             iCount = iCount + 1
             If iCount >= MAXMINUTES Then
                iCount = 0
                MsgBox "5 minutes expired"
             End If
          End Sub
    
    

  3. View the form in Form view.

REFERENCES

For information about creating event procedures, search for "event procedures," and then "Creating an Event Procedure" using the Microsoft Access Help menu.

For more information about the TimerInterval property, search for "TimerInterval," and then "TimerInterval Property" using the Microsoft Access Help menu.

For more information about the Timer event, search for "Timer," and then "Timer Event" using the Microsoft Access Help menu.


Keywords : FmsProp kberrmsg kbusage
Version : 2.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


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