>app.Main problem is with users leaving the program accidentally.
>You can use ON SHUTDOWN to trap an accidental exit using the kill button or several other scenarios. This doesn't help you if someone turns the computer off. In that case, I have always been a big fan of telling people not to turn off their computer without exiting the program.
Just about any routine you can think of won't prevent bad things from happening when someone turns the switch off, especially if you have a table open and locked when it happens. As a general rule, I never leave a table open unless it is being used.
A solution to trap users turning off their computer (if you keep an error log), is to add an entry when the user logs in with the description/message of "Computer unexpectedly shutdown". Reuse this message if an error occurs and then recreate the "Computer unexpectedly shutdown" row again. In
on shutdown delete this entry.
This way if the
on shutdown isn't called (ie power failure, or user turns off computer) you'll have an entry to isolate the problem/offender...
(A timer control can be used to update the entry's timestamp if needed to approximate the time of shutdown...)
-michael
My brain hurt like a warehouse, it had no room to spare, I had to cram so many things to store everthing in there. - David Bowie