Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access2002: Forcing closed a database.

Status
Not open for further replies.

Wozza

Programmer
Jan 29, 2002
13
GB
I have a database with a few different users. Every once in a while someone forgets to close out and it prevents upgrading or maintenance.

Has anyone ever set something up to either auto log a user off if they've been idle for X hours or set up some type of routine to close out all users?
 
I've never done this or tried it before but my idea would be to create a table with a single numeric field and enter one record with 0. Create a form bound to this field. This form is opened on the startup - Hidden. In the form, set the Timer to any non-zero value. On Timer increment this value by one. If the value > 1000, say, then open a pop-up a form with a one minute timer on it that says: "Database will close in 1 minute. Please Shut Down Now". Have a single Cancle Button that re-sets everything (sets value above back to 0. On the Timer for the Pop-Up form make it close the form. Then, On the timer of the startup form issue vba code to Close all forms, and Quit database.

On every form put an On Mouse Move Event that re-sets the value of the field in the table to 0 (using SQL or whatever). You will also need to put this code on other Events as well in case the user doesn't use the mouse.

That's all I can think of off the top of my head. Let me know if it works coz I'd be interested!
Cheers.
 
The method Edski writes about is detailed in many posts here. Do some searching and you should find several.



==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top