473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Automatically Log off idle users

Hi,
We have a shared Access 2000 database shared among many users within the company I work for.

many times, users open up the shared database and forget to close it.
So I cant even make modifications to it after work hours since users are logged in.

Is there a way to log off users after a long period of inactivity?

Let me know, thanks
Jun 8 '07 #1
22 17236
puppydogbuddy
1,923 Expert 1GB
Hi,
We have a shared Access 2000 database shared among many users within the company I work for.

many times, users open up the shared database and forget to close it.
So I cant even make modifications to it after work hours since users are logged in.

Is there a way to log off users after a long period of inactivity?

Let me know, thanks
Yes, but there is debate on the best way to accomplish it. Here is a link to Microsoft's way:

ACC: How to Detect User Idle Time or Inactivity
http://support.microsoft.com/?id=128814
Jun 8 '07 #2
Rabbit
12,516 Expert Mod 8TB
Hi,
We have a shared Access 2000 database shared among many users within the company I work for.

many times, users open up the shared database and forget to close it.
So I cant even make modifications to it after work hours since users are logged in.

Is there a way to log off users after a long period of inactivity?

Let me know, thanks
Is there a form that will always be open? Use a global variable and public functions with the Timer, Mouse Move, and Key Press events on every form to track how long a person has been idle.
Jun 8 '07 #3
I'll check out the website.
I do have a Mainform that links to other forms. Mainform always remains open even if other forms are being worked on.

I think I should put a timer on the MAINFORM. And then have countdown which alerts the user and gives them the option to reset timer or not.

How could I code this? And where on form should it be added? 'on current' ?
Jun 8 '07 #4
Rabbit
12,516 Expert Mod 8TB
I'll check out the website.
I do have a Mainform that links to other forms. Mainform always remains open even if other forms are being worked on.

I think I should put a timer on the MAINFORM. And then have countdown which alerts the user and gives them the option to reset timer or not.

How could I code this? And where on form should it be added? 'on current' ?
The link provides you with everything you need to implement one way of checking to see if someone's idle.Let us know if you have any touble.
Jun 8 '07 #5
Thanks for the link. I added the forms as mentioned on the microsoft site, only problem is an option whether or not to continue working did not appear.
It just closed right away.

I want to give the user a warning before closing by checking yes/no. if nothing is selected then it should proceed with quiting app.
Jun 11 '07 #6
This is what i have so far for sub routine action:

Sub IdleTimeDetected(ExpiredMinutes)
Dim Msg As String
strMsg = ""
strMsg = strMsg & "Application will CLOSE_"
strMsg = strMsg & "Click YES to continue working. Click NO to exit"
If MsgBox(strMsg, vbQuestion + vbYesNo, "No Activity detected") = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Else
Application.Quit A_SAVE
delayTimer = 10000
Application.Quit A_SAVE
End If

MsgBox Msg, 48
End Sub
Jun 11 '07 #7
puppydogbuddy
1,923 Expert 1GB
This is what i have so far for sub routine action:

Sub IdleTimeDetected(ExpiredMinutes)
Dim Msg As String
strMsg = ""
strMsg = strMsg & "Application will CLOSE_"
strMsg = strMsg & "Click YES to continue working. Click NO to exit"
If MsgBox(strMsg, vbQuestion + vbYesNo, "No Activity detected") = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Else
Application.Quit A_SAVE
delayTimer = 10000
Application.Quit A_SAVE
End If

MsgBox Msg, 48
End Sub

Change this:
Expand|Select|Wrap|Line Numbers
  1.            Else
  2.                Application.Quit A_SAVE
  3.         delayTimer = 10000
  4.         Application.Quit A_SAVE
  5.             End If
To this:
Expand|Select|Wrap|Line Numbers
  1.            Else
  2.       Application.Quit acSaveYes
  3.        delayTimer = 10000
  4.        End If
  5.  
You copied "Application.Quit A_SAVE" from Access 2.0 code. Access 2.0 is not Access 2000, rather it is the version that existed pre97.
Jun 11 '07 #8
OK. I'll update the commands.
Still though, I want application to autoclose.

So if VBYesNo no button selected within 10 seconds, then I want app to proceed with closing anyway.

How can this be accomplished?
Jun 11 '07 #9
puppydogbuddy
1,923 Expert 1GB
OK. I'll update the commands.
Still though, I want application to autoclose.

So if VBYesNo no button selected within 10 seconds, then I want app to proceed with closing anyway.

How can this be accomplished?
You did not post all of your code, so you may need to replace object names in the code below with the appropriate object names from your code.
Expand|Select|Wrap|Line Numbers
  1. Else
  2.        idleTime = 0                          'reset counters 
  3.        delayTimer = 10000
  4.        Do Until idleTime = 10000
  5.              'Hang loose
  6.              idleTime = idleTime + ElapsedTime
  7.              If idleTime = 10000 Then
  8.                 Exit Do
  9.              End If
  10.        Loop
  11.        delayTimer = 0
  12.        Application.Quit acSaveYes
  13. End If       
  14.  
Jun 11 '07 #10
FishVal
2,653 Expert 2GB
OK. I'll update the commands.
Still though, I want application to autoclose.

So if VBYesNo no button selected within 10 seconds, then I want app to proceed with closing anyway.

How can this be accomplished?
It cannot be accomplished in any way with msgbox.
While msgbox is active no events will be triggered in any form.

You should create your own form with warning message, Yes No buttons and timer.

Good Luck.
Jun 11 '07 #11
Proaccesspro
132 100+
Yes, but there is debate on the best way to accomplish it. Here is a link to Microsoft's way:

ACC: How to Detect User Idle Time or Inactivity
http://support.microsoft.com/?id=128814

Not sure where to place this code: (From MS' support page)

4. Create the following procedure in the form module: (How to access the FORM MODULE?)

Sub IdleTimeDetected (ExpiredMinutes)
Dim Msg As String
Msg = "No user activity detected in the last "
Msg = Msg & ExpiredMinutes & " minute(s)!"
MsgBox Msg, 48
End Sub
Jun 11 '07 #12
puppydogbuddy
1,923 Expert 1GB
It cannot be accomplished in any way with msgbox.
While msgbox is active no events will be triggered in any form.

You should create your own form with warning message, Yes No buttons and timer.

Good Luck.
FishVal,
If I understood correctly NewtoAccess wants the system administrator to have the last say before shutdown.. NewtoAccess requested (see below) a "no" response to trigger the application exit 10 seconds after it is clicked, which is what the above code does.

<<<<<<So if VBYesNo no button selected within 10 seconds, then I want app to proceed with closing anyway.>>>>>>
Jun 11 '07 #13
puppydogbuddy
1,923 Expert 1GB
NewtoAccess,
the Form module simply means the code behind a form (e.g. your idleTimeDected form) as opposed to a standard module or macro. You need to decide how you want the code to work before proceeding.
Jun 11 '07 #14
FishVal
2,653 Expert 2GB
FishVal,
If I understood correctly NewtoAccess wants the system administrator to have the last say before shutdown.. NewtoAccess requested (see below) a "no" response to trigger the application exit 10 seconds after it is clicked, which is what the above code does.

<<<<<<So if VBYesNo no button selected within 10 seconds, then I want app to proceed with closing anyway.>>>>>>
I'm curious whether you've tested the code.
I've checked that while MsgBox is active no Timer event will be triggered, no code will run asynchronously.
No such a problem with special form. In this case there are two opportunities:
1) to handle timer event from this warning form
2) to handle timer event from the IdleUser detecting form (somewhat more sophisticated)
Good luck.
Jun 11 '07 #15
puppydogbuddy
1,923 Expert 1GB
I'm curious whether you've tested the code.
I've checked that while MsgBox is active no Timer event will be triggered, no code will run asynchronously.
No such a problem with special form. In this case there are two opportunities:
1) to handle timer event from this warning form
2) to handle timer event from the IdleUser detecting form (somewhat more sophisticated)
Good luck.
FishVal,
I don't follow you. My suggested code runs only if the response to the message to the MsgBox is "No", so the MsgBox is no longer active at that point.
Jun 11 '07 #16
FishVal
2,653 Expert 2GB
FishVal,
I don't follow you. My suggested code runs only if the response to the message to the MsgBox is "No", so the MsgBox is no longer active at that point.
Sorry. Maybe I've not got a point. Lets straight it.
The logic is:
1. to detect idle user situation
2. to warn the user about db closing
2.1. User confirms quit -> quit
2.2. User denies quit -> restart idle timer
2.3. User doesn't respond within a definite time period -> quit

Am I right?
If so, MsgBox will be helpless in p. 2.3.
Jun 11 '07 #17
puppydogbuddy
1,923 Expert 1GB
Sorry. Maybe I've not got a point. Lets straight it.
The logic is:
1. to detect idle user situation
2. to warn the user about db closing
2.1. User confirms quit -> quit
2.2. User denies quit -> restart idle timer
2.3. User doesn't respond within a definite time period -> quit

Am I right?
If so, MsgBox will be helpless in p. 2.3.
FishVal,
OK, In writing my code, I understood NewToAccess to mean he wanted the ability to click the "no" button on the message box before actually following through with the shutdown of the application. If that is the case my code works, If that is not the case, and he wants the shutdown to occur without having to click the "no" button, then your scenario would be correct.
Jun 12 '07 #18
FishVal
2,653 Expert 2GB
FishVal,
OK, In writing my code, I understood NewToAccess to mean he wanted the ability to click the "no" button on the message box before actually following through with the shutdown of the application. If that is the case my code works, If that is not the case, and he wants the shutdown to occur without having to click the "no" button, then your scenario would be correct.
An old shit. Who will guard the guards.
Who will do it for himself, if he does it for everybody who doesn't do it himself.
:)

PS. Custom form provides additional functionality, for example displaying final countdown.
Jun 12 '07 #19
Proaccesspro
132 100+
NewtoAccess,
the Form module simply means the code behind a form (e.g. your idleTimeDected form) as opposed to a standard module or macro. You need to decide how you want the code to work before proceeding.
pretty much as descibed on the MS support site. After a set amount of idle time, I would like the user to automatically logged-off
Jun 25 '07 #20
Proaccesspro
132 100+
pretty much as descibed on the MS support site. After a set amount of idle time, I would like the user to automatically logged-off

I followed the directions on the MS support page. I put this code in the ON FOCUS EVENT

Private Sub Form_GotFocus()
Sub IdleTimeDetected(ExpiredMinutes)
Dim Msg As String
Msg = "No user activity detected in the last "
Msg = Msg & ExpiredMinutes & " minute(s)!"
MsgBox Msg, 48


End Sub


Not sure what to expect......How does the detectidletime form get focus?? Is there a macro I must write so that the form is constantly running in the background?
Jun 25 '07 #21
puppydogbuddy
1,923 Expert 1GB
I followed the directions on the MS support page. I put this code in the ON FOCUS EVENT

Private Sub Form_GotFocus()
Sub IdleTimeDetected(ExpiredMinutes)
Dim Msg As String
Msg = "No user activity detected in the last "
Msg = Msg & ExpiredMinutes & " minute(s)!"
MsgBox Msg, 48


End Sub


Not sure what to expect......How does the detectidletime form get focus?? Is there a macro I must write so that the form is constantly running in the background?
A picture is worth a thousand words. See the link below for a free download demo mdb with source code, entitled Detect & Logoff Idle Users.

http://www.utterangel.com/pages/acce...nloads.aspx#18
Jun 26 '07 #22
moisa
1
Hi,

I referred to the link of the ms support website and it works fine.
But is it possible to detect inactivity when one form is on top of another?
What I mean is I have a main form - formList and when I click on a command button within the formList, another form - formDetails will open up.

In other words, the formList must be open before I can open the formDetails.
I want to auto log off at formList and formDetails.
I've put the code in both forms. But while I'll keying in details in the formDetails - the formList will be inactive.

Basically what I'm looking for is - if the formDetails is opened, it will check inactivity on that form & log off from the application.
But if only the formList is opened, it will check inactivity on the formList.
Dec 6 '07 #23

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ACI | last post by:
Auto Close Idle helps you utilize your multi-user concurrent users licenses more efficiently. It closes unattended clients remotely after a certain period of time or manually. Furthermore, clients...
3
by: Dave | last post by:
I am moving a web to a new address. The old address will be shut down in several weeks. Is there a way to automatically redirect users who come to the old site in these last few weeks to the...
3
by: Jim G | last post by:
Hi, We have a limited number of licenses to some software we have installed on our users desktops. The problem is that sometimes the users open up the application and then don't use it all day....
9
by: jab3 | last post by:
So I'm considering a small project that involves online file storage. Let's say I wanted to set up a site that allows people to log-on, create an account, and then have space to upload files. The...
4
by: Debscanadian | last post by:
Access 2003 I have successfully created a hidden form as described in the KB article for logging out idle users. Now I am faced with the problem that if the open form(s)/subforms are dirty, I...
2
by: gomzi | last post by:
Hi, I would like to know as to how I could accomplish the task of automatically updating my users gridview when I insert a new row in my database. i.e. Suppose I insert a new row in a database,...
4
by: Snoopy33 | last post by:
I have just sat up a database that has 2 - 10 users at any given time. Everything is running smooth, however when someone's computer goes into standby it seems to lock everyone else out of the...
5
by: camilin87 | last post by:
hello. I'm building a site using php I have a setup.php page wich has at the begining session_start(); and every single page from my site includes setup.php. When a user registers I save in...
3
by: Sharkiness | last post by:
Good Afternoon, I would like some help on creating some code on my forms Load function so that when a user opens it they will automatically have only their allocated records available for viewing....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.