Can you program Access to automatically close if not in use

Noreene Patrick

Registered User.
Local time
Today, 13:30
Joined
Jul 18, 2002
Messages
223
We are having a problem with mulitple users leaving an Access db open and then I am not able to make new reports, etc. without calling everyone to close their session.

Is there a way to automatically close a db if user has not used in certain amount of time?

Thanks, Noreene
 
If you have a startup form (see Help on startup forms), and if that form minimizes itself and hides itself, it can have a timer still active via VBA.

If your users always go through forms, it is no big deal to have each form reset a global variable that the timer checks. Say you set a 1-minute timer and your global counter (in a global module, of course...) is 15. Your hidden form counts down 1 count every time the timer goes off. Your OTHER forms reset the time to 15 every time the user takes some action that involves an event. If the counter ever reaches 0, the hidden form's timer routine can make the application do a QUIT.
 
Whoops! Good catch, Pat.

Yes, stop timers before updating things. Having that code active in the background cause you to run into the problem of updating an active object.
 

Users who are viewing this thread

Back
Top Bottom