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

>
Want a good read? Try The Summer of His Life (available on Amazon!)

LogUsersOffNonUse.mdb (intermediate)

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


Joined: 20 Feb 2008
Status: Offline
Points: 261
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.
 

LogUsersOffNonUse.mdb

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)
 
Download

Access 2010-2019 accdb: LogUsersOffNonUse_2010.zip
Access 2000 DAO (25 KB): uploads/5/LogUsersOffNonUse2k.zip
Access 97 (22 KB): uploads/5/LogUsersOffNonUse97.zip 


Consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links
>
Want a good read? Try The Summer of His Life (available on Amazon!)

Back to Top
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 20 Feb 2008
Status: Offline
Points: 261
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Posted: 17 Mar 2020 at 7:35pm
Update: Access 2010-2019 accdb: LogUsersOffNonUse_2010.zip
Consider donating $1 per sample downloaded, find out why here.<
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.