I have a split configuration Access 2013 application and want to have the application detect when Windows is logging a user off. I want to be able to trap the event, so that the application can clean up the db and then quit.
I have a split configuration Access 2013 application and want to have the application detect when Windows is logging a user off. I want to be able to trap the event, so that the application can clean up the db and then quit.
In theory you just need a message handler to look for these messages:
Thanks - I got that far, but haven't been able to figure out the VBA code to implement this. Any detailed help you can provide will be much appreciated.In theory you just need a message handler to look for these messages:
I can only find VB.net example. https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Unsure of the conditions you foresee, but if Access is shut down via Taskmanager -- I think you are out of luck. More generally, if there is some catastrophic failure, then I don't think there is any event available to Access to do some damage control.
If Access is shut down normally, even by user clicking the X to shut down the application, Access will try to close all open objects.
So it you load a hidden form, or hide a loaded form, and you include an unload event for that form that includes writing some message to a log/activity table (or file), I think that event and write will occur before the Access application is terminated.
I have not worked with, not found any reference using vba with,
I did find this after several google attempts. (Don't know if it's applicable; it's from 2004)
https://www.experts-exchange.com/que...plication.html