>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.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California