How to detect idle time and kick users out

vent

Registered User.
Local time
Today, 17:43
Joined
May 5, 2017
Messages
160
Hi everyone,

So I'm sure many of you are familiar with the famous idle time detection code from https://support.microsoft.com/en-ca/help/128814/acc-how-to-detect-user-idle-time-or-inactivity. I wanted to make a slight change to this code where the users are automatically logged off. The code is exactly the same except near the end. The change I made is as follows:

Code:
' Does the total expired time exceed the IDLEMINUTES?
         ExpiredMinutes = (ExpiredTime / 1000) / 60
         If ExpiredMinutes >= IDLEMINUTES Then
            ' ...if so, then reset the expired time to zero...
            ExpiredTime = 0
            ' ...and call the IdleTimeDetected subroutine.
            IdleTimeDetected ExpiredMinutes
            [COLOR="Red"]Application.Quit acSaveYes[/COLOR]
         End If

The reason I made this change is because a user on here had requested the same thing and was informed to make this change. The problem I'm experience is I keep getting an error saying The expression On Timer you entered as the event property setting produced the following error: Expected Sub, Function, or Property

I suspect it has something to do with the macro I created. I thought I did this correctly but if I have made a mistake I need to know what it is. If anyone has any suggestions that would be much appreciated!
 

Attachments

  • autoexec.PNG
    autoexec.PNG
    12.6 KB · Views: 257
Last edited:

Users who are viewing this thread

Back
Top Bottom