LogUsersOffNonUse.mdb (intermediate)

Please consider donating $1 per sample downloaded, find out why here
Download
LogUsersOffNonUse.zip
Access 97 (22 KB)

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)

 

Feedback

 

Need Winzip?

Return to Main Page