Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

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

 
 
Chat with a LIVE Microsoft Access Expert!
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-04-2006, 09:17 AM
OpnSeason OpnSeason is offline
Registered User
 
Join Date: Mar 2006
Location: Suffolk, VA
Posts: 3
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.

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

Last edited by OpnSeason; 03-20-2006 at 01:55 AM.. Reason: Revision
Sponsored Links
  #2  
Old 08-04-2006, 10:07 AM
MStCyr MStCyr is offline
Registered User
 
Join Date: Sep 2003
Location: Ottawa, Canada
Posts: 333
MStCyr is on a distinguished road
Thank you for your post, however we have some 10 different posts on this subject
  #3  
Old 08-07-2006, 02:04 AM
Sheila.deJesus Sheila.deJesus is offline
She
 
Join Date: Jul 2006
Posts: 70
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
Sponsored Links
Closed Thread

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote shutdown of a shared DB... bikeman77 Modules & VBA 21 06-18-2007 01:27 PM
Quit Access and shutdown JackS123 Modules & VBA 3 11-13-2005 11:35 AM
Remote ShutDown skea General 10 06-10-2005 06:55 AM
Forced Requery to execute first le888 Forms 8 02-16-2004 05: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 09:39 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World