ACC: How to Detect User Idle Time or InactivityLast reviewed: October 24, 1997Article ID: Q128814 |
The information in this article applies to:
SUMMARYModerate: Requires basic macro, coding, and interoperability skills. This article describes 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:
ARTICLE-ID: Q150895 TITLE : ACC95: Microsoft Access Sample Forms Available on MSL ARTICLE-ID: Q175066 TITLE : ACC97: Microsoft Access 97 Sample Forms Available on MSL MORE INFORMATION
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:
Macro Name Action --------------------- AutoExec OpenForm AutoExec Actions ---------------------------- OpenForm: Form Name: DetectIdleTime View: Form Filter Name: Where Condition: Data Mode: Edit Window Mode: HiddenYou 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 exit with the following event procedure: In Microsoft Access 7.0 and 97:
Sub IdleTimeDetected (ExpiredMinutes) Application.Quit acSaveYes End SubIn Microsoft Access 2.0:
Sub IdleTimeDetected (ExpiredMinutes) Application.Quit A_SAVE End SubThis procedure causes Microsoft Access to quit the application, saving all objects without displaying a dialog box.
REFERENCESFor more information about the Timer event, search the Help Index for "Timer event." Keywords : kbusage FmsHowTo Version : 2.0 7.0 97 Platform : WINDOWS Hardware : x86 Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |