Results 1 to 5 of 5
  1. #1
    jcharrow is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Dec 2017
    Posts
    2

    Detect Windows shutdown or logoff

    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.

  2. #2
    mrfrisky330 is offline Novice
    Windows XP Access 2002
    Join Date
    Dec 2017
    Posts
    3
    In theory you just need a message handler to look for these messages:



  3. #3
    jcharrow is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Dec 2017
    Posts
    2

    How to add a message handler?

    Quote Originally Posted by mrfrisky330 View Post
    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.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,648
    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.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    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

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 07-28-2017, 06:02 PM
  2. Logon/Logoff Tracking
    By ChobeyGuddu in forum Access
    Replies: 5
    Last Post: 02-15-2017, 07:38 AM
  3. Detect which version of Windows is running
    By GraeagleBill in forum Programming
    Replies: 2
    Last Post: 12-31-2012, 05:07 PM
  4. Replies: 0
    Last Post: 12-03-2010, 12:56 AM
  5. Access won't shutdown
    By farlowj in forum Access
    Replies: 3
    Last Post: 07-10-2009, 06:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums