ACC: How to Detect User Idle Time or Inactivity
This article was previously published under Q128814
Moderate: Requires basic macro, coding, and interoperability skills.
On This PageSUMMARY
This article shows you how to create a procedure that will run if your
Microsoft Access application does not detect any user input for a specified
period of time.
This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications" manual. NOTE: Visual Basic for Applications (used in Microsoft Access 7.0 and Microsoft Access 97) is called Access Basic in version 2.0. NOTE: This article explains a technique demonstrated in the sample files, FrmSampl.exe (for Microsoft Access for Windows 95 version 7.0) and FrmSmp97.exe (for Microsoft Access 97). For information about how to obtain these sample files, please see the following articles in the Microsoft Knowledge Base: 150895 (http://support.microsoft.com/kb/150895/EN-US/) ACC95: Microsoft Access Sample Forms Available in Download Center
175066 (http://support.microsoft.com/kb/175066/EN-US/) ACC97: Microsoft Access 97 Sample Forms Available in Download Center
MORE INFORMATIONHow to Create the DetectIdleTime Form
How to Use the DetectIdleTime FormTo hide the DetectIdleTime form when the application opens, create the following AutoExec macro:
Macro Name Action
---------------------
AutoExec OpenForm
AutoExec Actions
----------------------------
OpenForm:
Form Name: DetectIdleTime
View: Form
Filter Name:
Where Condition:
Data Mode: Edit
Window Mode: Hidden
You can add code to the IdleTimeDetected procedure so that the procedure
runs if there is no user activity for the amount of time specified in the
IDLEMINUTES constant value. For example, you could have Microsoft Access
quit with the following event procedure:
In Microsoft Access 7.0 and 97:
In Microsoft Access 2.0:
This procedure causes Microsoft Access to quit the application, saving all
objects without displaying a dialog box.
REFERENCES
For more information about the Timer event, search the Help Index for
Timer event.
APPLIES TO
| Article Translations
|
Back to the top
