<%dim crumb crumb="Idle Time Logout" Crumb2="User Inactivity Logout" crumb1="Visual Basic to Automatic Close Session & Logout" %> Logout User After Period of Inactivity
Home  Fees/Services  Access 2010 Template  Access Tutorial  Access Download  Articles  Search  Contact  Privacy  Links

<%if len(crumb2)>2 then response.write crumb2 else response.write ">

Open Email Using SendObject Access Download

User Inactivity Logout VBA Code

Disable Shift Key Demo

Send Email Microsoft Access Tutorial Download (Advanced)

Sequential Counter in Query

Multi Select List Box Query Parameters

Row Level Data Security

Programming MS Access Security Alternative

Single User Inventory Calculations Download

How To Perform Multi-User Inventory Calculations

Make Dependent Combo Box Code MS Access Tutorial

Union Query Example (Simple)

Union Query (Advanced) Access Tutorial

How To Fill Fields From Combo Box

Use Global Variables as Parameters

Continuous Form Dependent Combo Box

How To Program Continuous-Continuous Master/Detail Forms

Access Bar Chart / Bar Graph

Programming Crosstab Query Example

TransferText & OutputTo Microsoft Access

DoCmd.OpenForm & OpenArgs VBA Example

Running Sum Query Method

Choose Command Dynamic SQL Order By

Access Conditional Format

Access Report Banding

Popup Form Control Method

<% gnum="09466400141" %>

How to Detect User Idle Time or Inactivity

User inactivity logout is great tool to have in a multi-user database environment.  Sometimes you will have users located in multiple buildings, cities, or even countries.  It is often critical that users logout when they are done working on the database.  This visual basic code was developed for Microsoft Access but it should work, with minor modifications with any forms-based database with timer events available to the programmer. The basic functioning of this database requires a form in the background or hidden from view.  This form contains the code and timers to check for user inactivity.  User inactivity is basically checking to see if the active form control has changed during the specified inactivity time out period - such as 20 minutes.  The form examines the currently active form control every so often determined by the setting of the Timer Event on the form.  This example has this value set to 10 seconds (10000 milliseconds).  In a real database you would normally set this to a larger value such as 30 seconds or one minute.

All the code is available in this downloadable Microsoft Access example.  Give it a try and let us know how you like it or if you have problems running it:

User Idle Time Disconnect

idle time user force disconnect

Microsoft Office:
MS Access 2003
Access 2007
Access 2010
Access 2013
Access 2016
<% dim rnum Randomize rnum = Int(Rnd * 10) + 1 response.write " Updated On " & now-rnum %>

Contact Information

<% Response.write "Copyright 2000-" & year(now) & " Blue Claw Database Design" %>

MS Access 2013, Access 2010 & Microsoft Office 2007