Trap Windows Start and Turn Off Computer

helmpost

Registered User.
Local time
Today, 00:16
Joined
Jul 16, 2007
Messages
21
Folks

My sailing club race management system works very well when all the many users exit elegantly from the system. This elegance includes following a number of 'Exit' buttons which finally sends the days results by email before finally exiting Access. All very good but, some users just don't get the Exit strategy - they just shut down the PC by hitting Start and Turn Off Computer - no data is lost but the results don't get sent. My only current idea is to find some way to trap the Start, Turn Off Computer sequence and open a msgbox is the application or even access is still running ... but no idea where to begin! Open to all or any suggestions.

I am using Windows XP, SP3 and Access 2002.

Thank you all
 
Start by knocking those silly users on their heads :)

What about adding the "send code" to the On-close event rather than behind an Exit button.
That way the data might get send while Access shuts down during the PC shut-down process.

I would test it, but my PC takes SO long to re-start...
 
Thanks for replying Freshman.

I'm not sure it really matters how application closure is achieved if that method is overwritten by the PC shutting down? Somehow, the PC shutdown process needs to be interruped before it can do anything so that the user can get back into the application and shut it down properly ... or so that I can programm the email sequence (actually a report, convert to PDF, e mail and then Access closure with compact and repair options selected).

Regards, Brian
 
I'm not sure it really matters how application closure is achieved if that method is overwritten by the PC shutting down?

I'm also not sure but would at least test it by moving the code from behind the button to the on-close event. Or create a test db with some code behind the on-close event to test it.

Somehow, the PC shutdown process needs to be interruped

I understand 100% what you need and also Googled on eg: "Trap windows restart" etc. But could not find too much there that can be used :(

Good luck and let us know if the on-close event thingy does the trick or if you find a nice solution - might be intresting to know.
 
Just to confirm, even a simple msgbox in the On Close event is overidden by a Windows Start/Turn Off Computer action. I suspect what's needed is something within Windows rather than Access/VBA - possibly a Windows API call .....
 
Ahhh bummer. Well at least you tried.

I agree - maybe post on one of the Windows forums out there as it is not really an Access solution you looking for here.

Good luck finding a solution.
 

Users who are viewing this thread

Back
Top Bottom