How to force users out of an Access application after a certain period of inactivity

I need to do some work on a client's DB.  Despite the clients best efforts and repeated emails some user don't close the Access 2013 application when leaving for the day.  I did some research on forcing user out of the DB after some period of inactivity and came up with this solution on the Microsoft website.

Microsoft Suggestion For Forcing User Out of an Application

I am hesitant to use this one due to its use of 'TimerInterval'.  Somewhere along the line in my many years of Access development I remember being warned against using the 'TImerInterval' because in some way it could become problematic.  

Do any of you have experience with the having to remotely shutdown users due to inactivity?  DId you use the 'TImerInterval' function or are there better methods?
LVL 1
mlcktmguyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fabrice LambertConsultingCommented:
Well, MS Access wasn't build with real time in mind, but it work (more or less).

Be warned that sometimes, user shut down the application, but for whatever reasons, a connection remain open, so it isn't an absolute solution.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
This is free and will work for you. I built an entire Forced Shutdown module to shutdown multiple dbs based on Peter's app.

http://www.peterssoftware.com/isd.htm

Check it out.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
One important thing here is that you not force the user out outside of the application.   That can corrupt the DB.

 There is a passive shutdown feature built into Access, but that relies on the user to exit (it just prevents new users from connecting to the DB).

 So whatever you do, it needs to be built into the app.   Usually that involves setting some type of flag, then within the app, checking for that flag and doing the exit from the app.

Jim.
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

John TsioumprisSoftware & Systems EngineerCommented:
Well there is another way...(too bad i don't have the time to polish it and release it) ...you just could locate the database on the BE and close them...like connecting to the machine that "holds" the back end
The Manual way --> Shared Folders --> Open Files --> Close Them
The Automatic way  --> it can be done via VBA.
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
@John,

 <<The Manual way --> Shared Folders --> Open Files --> Close Them>>

  You absolutely do not want to do this on a JET/ACE database.   You never want to force close a connection.

  If you do it this way, you have to be absolutely sure the user is idle.  If they are working with the DB, you can corrupt the DB.

Jim.
Daniel PineaultPresident / Owner CARDA Consultants Inc.Commented:
There is nothing wrong with using a Timer.  Obviously, you don't want to run a timer on every form ..., but in the context that you are talking about it is absolutely fine.

As for what can be done, I urge you to look over the following 2 solution (similar, but for different applications).


I've been using them in pretty much all my databases for 10+ years and never had any issues whatsoever.
PatHartmanCommented:
The timer is more of a danger to you during development.  That is what you need to watch out for.  In the rare instances where I use a timer for anything, I add code to the open event of the opening form to check to see if it is me opening the database.  If it is me, I pop up a question asking if I want to run the timer events.  I say yes if the timer event code is what I am testing.  I say no in all other cases and the code sets the timers all off.  What you are trying to avoid is opening an object and making design changes when there is an open form with a timer event running.  You can loose your changes and it can corrupt the database.
John TsioumprisSoftware & Systems EngineerCommented:
@Jim in the 10+ years i have used in a heavy environment of 100+ users i can't remember if i had a case of corruption.
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Depends on when your trying it.  Again, if there is not activity, you can get away with it.

 But this is no different than doing a CTRL/Alt/Del, Rebooting the server, etc.   None of which you want to do with a JET/ACE DB.

 Your terminating the connection without closing the DB through Access.

Jim.
Mark EdwardsChief Technology OfficerCommented:
I've used the timer in my app shell that I use to build new apps with.  Just watch the demo to see how it works:
https://www.youtube.com/watch?v=-A8fu--aa6k

It depends on how you close out.  There is a difference between "close" and "quit".  If you try to close gracefully and a popup (to save or do whatever) opens, then it can halt your closing code.  You'll want to avoid this by just "Quit", but even then, no guarantees that everything will work right.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.