Forced Shutdown Question

randolphoralph

Registered User.
Local time
Today, 00:58
Joined
Aug 4, 2008
Messages
101
I am looking for a way to force a shutdown on a database. I have reviewed the post http://www.access-programmers.co.uk/forums/showthread.php?t=103278 and follow this example with no luck.

After following this step by step when I open the Shutdown.mdb (without holding down the Shift key) the ShutdownMSG form appears and the countdown begans to shutdown.

I am not sure how to get this not to shutdown right away.

Since the form ShutdownMSG appears in the Shutdown.mdb I assume that the users would be working in Shutdown.mdb. Is that correct?

Also, would the users have to hold down the Shift key each time they open the database in order to prevent the database from shutting down?
 
I took this general approach some 5 years ago.

1. Build a startup form that displays a "splash" logo or something much like that. Could be a company logo, a database title page, you name it. Have a button on that page to say "go into application." When the user clicks the button, Minimize the form and make it go Hidden. But it is still OPEN.

2. Once the form goes "stealth" like that, set up a timer in the Form.Timer property of this splash form. Use the OnTimer property to check for various kinds of activity. If you use a switchboard, then have something such as an OnClick routine for every button to include an update of a global / public date field in a general module. Store Now() in that date.

3. Once per minute (or pick another time that isn't too much of a processing load), check the "timestamp of last action." If it is greater than your limit, force a DoCmd.Quit on that sucker.

4. Have another little table somewhere, hidden to the world and read-only to everyone except you. In that table, drop date/time stamps for the next database maintenance window. (I made the maintenance window visible on the splash screen.) Sort by date in this table, but only show the first date later than the current time. Don't show any dates that are in the past.

5. IF you find that Now() is between the starting and stopping time for a maintenance event, issue a message with a timer in it saying, "Sayanora" and then issue the DoCmd.Quit again.

This DOES presume that your users can only see the switchboard, not the DB window.
 
Simple Software Solutions

Access provided a sample of how to detect idle time witin an application. I modified this and the analogy of how it works for me is thus.

Step 1: Login Screen opens as start up form
Step 2: Main Menu Opens after login and login screen closes
Step 3: User opens a second form

User does not do anything within a specified time (3 minutes)

IdleTime Detected

Step 4: Check to see if the current form is the main menu
if not it closes the current form
else it closes the main menu and opend the login screen

If you want you could substitue the opening of the login screen to quitting the application.

CodeMaster::cool:
 

Users who are viewing this thread

Back
Top Bottom