Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
ACC: How to Detect User Idle Time or Inactivity
Article ID: 128814 - View products that this article applies to.
This article was previously published under Q128814
Moderate: Requires basic macro, coding, and interoperability skills.
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:
(http://support.microsoft.com/kb/150895/EN-US/ )ACC95: Microsoft Access Sample Forms Available in Download Center
(http://support.microsoft.com/kb/175066/EN-US/ )ACC97: Microsoft Access 97 Sample Forms Available in Download Center
How to Create the DetectIdleTime Form
How to Use the DetectIdleTime FormTo hide the DetectIdleTime form when the application opens, create the following AutoExec macro:
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:
Macro Name Action --------------------- AutoExec OpenForm AutoExec Actions ---------------------------- OpenForm: Form Name: DetectIdleTime View: Form Filter Name: Where Condition: Data Mode: Edit Window Mode: Hidden
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.
For more information about the Timer event, search the Help Index for Timer event.
Article ID: 128814 - Last Review: January 19, 2007 - Revision: 2.3