Need help with form AutoShutDown (developed by Garry Robinson)

T

Tom

I recently purchased Garry Robinson's "Microsoft Access Database Protection
and Security" book.

In his demo database -- chapter 5 -- Garry lists the form "frmAutoShutDown".
I tried to implement the Auto Shutdown form into one of my databases, but
I'm not successful w/ automatically having the mdb shut down at a specified
time.

Here's what I have done:
- Imported "frmAutoShutDown" into my database
- Changed the value for SHUTDOWNHOUR from "16" to "17".
- All other const remained the same... please see below

++++++++++++++++++++++++++++++
Const MSGMINS = 3 ' Minutes between checking for system
shutdowns
Const SHUTDOWNFLAG = True ' if true then the system will shutdown once a
day
Const SHUTDOWNHOUR = 17 ' Automatic shutdown hour (24 hour time)
Const WARNSTARTMINS = 0 ' Time in minutes that warnings start being
issued
Const WARNENDMINS = 10 ' Time in minutes that warnings stop being
issued
Const SHUTDOWNSTARTMINS = 10 ' Starting time in minutes for the shutdown
Const SHUTDOWNENDMINS = 30 ' Final time in minutes for the shutdown
++++++++++++++++++++++++++++++

I opened my database at 4:25 pm (or 16:25). I was monitoring the db for
"alert messages" from 4:30 (16:30) to 5:00 (17:00). However, none popped
up, nor did the database automatically shut down at 5:00 pm.

What am I missing?

Thanks,
Tom

BTW, I tested this on a standalone laptop. I will need to include this in
the network version. I guess this shouldn't make a difference for testing
purposes though.
 
D

Douglas J. Steele

If you look closely at the code, it should have shut down sometime between
17:10 and 17:30 (and you should have got a warning message sometime between
17:00 and 17:10.

If Hour(Time()) = SHUTDOWNHOUR Then
If Minute(Time()) > SHUTDOWNSTARTMINS And Minute(Time()) <
SHUTDOWNENDMINS Then
' Shuts down
ElseIf Minute(Time()) > WARNSTARTMINS And Minute(Time()) < WARNENDMINS
Then
' Gives warning
End If
End If
 
T

Tom

Doug:

Okay... I guess I misinterpreted the times. I'm not sure if there's
something else missing (on may part).

Once I read your posting, I changed the following:
- set SHUTDOWNHOUR = 19
- advanced my system's clock to 6:59 pm
- monitored the database that has the frmAutoShutDown included
- no message popped up between 1900 and 1910
- the database is still open at 1931

Now, I did not just "stare" at the screen for 30 minutes... I continued my
work (as I would expect users do during the work day) in other applications
while the database was in the background (not minimized).

Could you think of anything else? Or do you know of another solution that
might work similarly to Garry's form.

Here's what I'd like to achieve:
- although it might be nice to "force users" off the database by just
shutting it down, I don't think I'd go that route.
- I simply need something that will shut it down e.g. around 5:30. If a
user didn't save the work by then... too bad. Now it would be nice to show
them a warning message (let's say 5 minutes before shutting it down).

Any ideas?
 
T

Tom

Thanks, Doug. The first link didn't show me anything about shutting down
form (except idle textbox). Still, this is a fantastic sample db... I can
definitely find some other stuff in there.

The 2nd link is too abrupt... BAM... and user is "dead".

Again, thanks for sharing this w/ me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top