Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - LogUsersOffNonUse.mdb (intermediate)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Please consider donating $1 per sample downloaded, (find out why here)

LogUsersOffNonUse.mdb (intermediate)

 Post Reply Post Reply
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP

Joined: 20 Feb 2008
Status: Offline
Points: 257
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Topic: LogUsersOffNonUse.mdb (intermediate)
    Posted: 01 Aug 2008 at 12:45am

Please consider donating $1 per sample downloaded, find out why here.


This sample illustrates how to automatically log your user out of an application after a period of inaction.

There are several pieces:

1) code in the switchboard form OnTimer and OnLoad events

2) frm_ExitNow modal form

3) code in frm_ExitNow OnTimer and OnLoad events

The difficult thing here is deciding what INACTION means. I have chosen to define it as a period in which none of the controls at the bottom have received the focus. In the OnGotFocus event of each control, I call the sub routine UpdateActivity, which simply sets the current time (Now) into a record in the table tblLastUsed.

I have set the value to 1 minute for testing purposes. You change this by setting the TimerInterval in the form properties. ( 1000*Number of seconds ) You also need to set the value in the Timer Event of the form (see the code for instructions)
Access 97 (22 KB):
Access 2000 DAO (25 KB): uploads/5/

Consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down