Go Back   Access World Forums > Microsoft Access Reference > Sample Databases

Closed Thread
Thread Tools Rate Thread Display Modes
Old 03-04-2006, 10:17 AM   #1
Registered User
Join Date: Mar 2006
Location: Suffolk, VA
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
OpnSeason is on a distinguished road
Cool Forced shutdown/inactivity shutdown

Hello Code Hungry Vultures!

This is a database demo complete with source. It illustrates how to force a shutdown or automatically shutdown from inactivity for a specified number of minutes.

This allows forcing users out for emergency maintenance such as compacting & repairing because of partial corruption or whatever, and inactivity shutdown for those who loiter in the database when off hours scheduled maintenance is needed such as compacting & repairing, or updates to tables, etc.

It is a front end database with a linked back end database.

On first opening Shutdown.mdb use the shift key to prevent the Autoexec macro from executing.

Then refresh the link for table MsgCenter in BACK_END.mdb.

The fields in the MsgCenter table:

ShowMsg----------Yes/No---Set this to True/Yes to force shutdown
MSG--------------Text-----Message to display in ShutdownMsg form
MsgBxTitlBar-----Text-----Titlebar caption to display in ShutdownMsg form
MaxInactiveTime--Integer--Max Inactivity Minutes
StartMonitor-----Integer--Time of day to start monitoring inactivity - 0 (12AM) to 24 (12PM)
EndMonitor-------Integer--Time of day to end monitoring inactivity - 0 (12AM) to 24 (12PM)

After link is refreshed either exit Shutdown.mdb and open again to run the autoexec macro or just run the autoexec macro without exiting.

Then open the MsgCenter table & click ShowMsg & close the table.
Forced shutdown will occur immediately.

For inactivity shutdown:

Open the MsgCenter table.

Change StartMonitor to an hour earlier than the current time.
Change EndMonitor to an hour later than the current time.

Set MaxInactiveTime to 1 (1 minute) and close the table.

Inactivity shutdown will occur in 1 minute.

Attached Files
File Type: zip Shutdown.zip (30.4 KB, 3827 views)

Last edited by OpnSeason; 03-20-2006 at 02:55 AM. Reason: Revision
OpnSeason is offline  
Old 08-04-2006, 10:07 AM   #2
Newly Registered User
Join Date: Sep 2003
Location: Ottawa, Canada
Posts: 333
Thanks: 0
Thanked 43 Times in 39 Posts
MStCyr is on a distinguished road
Thank you for your post, however we have some 10 different posts on this subject
MStCyr is offline  
Old 08-07-2006, 02:04 AM   #3
Join Date: Jul 2006
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Sheila.deJesus is an unknown quantity at this point
Send a message via Yahoo to Sheila.deJesus
Thanks for your post OpnSeason!!!

Such is a very useful tool.

The code works on my db, except that.... (forgive my ignorance for i am an access novice) i don't know why the inactivity shutdown occurs immediately as soon as i open the form. I did exactly what you've stated on your post:

I open the MsgCenter table.

I changed StartMonitor to an hour earlier than the current time.
I change EndMonitor to an hour later than the current time.

Then, i set the MaxInactiveTime to 2minutes and close the table.

But, the countdown starts immediately at 20sec.

Where did i go wrong? :-(


Sheila.deJesus is offline  
Closed Thread

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote shutdown of a shared DB... bikeman77 Modules & VBA 24 09-18-2014 07:04 AM
Quit Access and shutdown JackS123 Modules & VBA 3 11-13-2005 12:35 PM
Remote ShutDown skea General 10 06-10-2005 06:55 AM
Forced Requery to execute first le888 Forms 8 02-16-2004 06:09 AM
Way to Turn Off Computer Programically After Shutdown? llyal Modules & VBA 2 09-25-2001 08:37 AM

All times are GMT -8. The time now is 03:49 PM.

Microsoft Access Help
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World