ACC1x: How to Implement a Timer Within MS Access ApplicationsLast reviewed: June 8, 1997Article ID: Q95924 |
The information in this article applies to:
SUMMARYThere is no timer control built into Microsoft Access version 1.x. To implement a timer, you must create an Access Basic module that creates a timing sequence in your application.
MORE INFORMATIONTo create a timer within your Microsoft Access application, you must call two functions. One function starts the sequence, and another function sets a global variable that tells the first function to stop performing the timing iteration. This article assumes you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Introduction to Programming" manual. In the first function, called StartTimer(), you execute an endless loop that performs the timing update and the DoEvents() function. The DoEvents() function instructs the Access Basic function to release the computer's CPU to other tasks, such as your form, other applications within Microsoft Windows, and most importantly the StopTimer() function. The StopTimer() function sets the global variable that the StartTimer() function checks to determine when to stop looping. To create an example, follow the instructions below. Once these are done, open the form in Browse mode and press the Start Timer button. You should see the timing being performed by the updating in the text box. At any point you can stop the timing sequence by pressing the Stop Timer button.
|
Keywords : kbprg PgmHowTo PgmOthr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |