Have a hidden form triggered from your login form, have a timer on the hidden form set to 30 minutes and get it to restart the timer whenever you do something, or not (up to you!)... after your 30 minutes, have the hidden form close... in the close event of the hidden form, put in a quit application command. (You have gotta be quite careful about how you check for the close event as you may change the focus during data entry.)
Note:
It is also an opportunity for you to put in an override to the timer too, so you could kick people out of the db if you wanted to. Personally, Id put the "trigger" field on the hidden form as something like a checkbox (you might even wanna have it bound to a single field, single record table?), and have the checkbox set by your timer... it would mean you could go in, set the checkbox to true/false/whatever and effectively lock the db, say whilst making a change or doing some admin.
|