![]() |
LogUsersOffNonUse.mdb (intermediate) |
Post Reply ![]() |
Author | |
Roger Carlson ![]() Microsoft MVP ![]() Joined: 20 Feb 2008 Status: Offline Points: 261 |
![]() ![]() ![]() ![]() ![]() Posted: 17 Mar 2020 at 7:35pm |
Update:
|
|
|
|
![]() |
|
Sponsored Links | Want a good read? Try The Summer of His Life (available on Amazon!) |
![]() |
|
Roger Carlson ![]() Microsoft MVP ![]() Joined: 20 Feb 2008 Status: Offline Points: 261 |
![]() ![]() ![]() ![]() ![]() |
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) Access 2010-2019 accdb: LogUsersOffNonUse_2010.zip |
|
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |