Results 1 to 4 of 4
  1. #1
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60

    How do I capture Access DB exit event

    Hi folks



    I want to capture the "Exit" event when the user closes the DB (click on the X on top right side of the window, or use file exit.

    Any feedback would be appreciated very much.

    Thanks
    Mike

  2. #2
    drexasaurus's Avatar
    drexasaurus is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Location
    Santa Ana, CA
    Posts
    60
    There is no easy way, unfortunately to capture this event.

    If you have 2007 or 2010 installed, you can alter the home tab with some work and XML so they might not be able to exit from there, and I saw this article on the web from disabling the 'X' button on the upper-right hand side. http://www.fmsinc.com/microsoftacces...eventclose.asp
    (I never tested this article out myself yet). Then of course, you would provide you own way to exit the program using something like the DoCmd.Quit function with whatever other code you wanted to run first.

    Something that I have done, which isn't 100% reliable, but if you are working on a project that is locked down from the user perspective and has a form that they can't close (like a menu) or a hidden form that is up all the time, you can but code into the close even of that form. That will fire when you close the program. I track some user information this way and it works pretty well. Of course, from a professional perspective, pretty well isn't always good enough...

    Just some ideas.

  3. #3
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60
    Hi Drexasaurus

    Thank you for the quick reply and the reference. I will certainly check it.

    Mike

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Actually there is a very easy way to capture and maybe stop that application Exit event. Use the AutoExec macro to load a hidden form at the start of the application. This form will then be the last to close when the user quits the application. I use this form for a number of housekeeping chores. It starts my persistant connection and allows me to kick everyone off if I need to do maintenance. It also does any cleanup necessary when the application closes, like deleting any temporary db I may have used. It can also cancel the closing if the application if something needs to be completed before close.

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

Similar Threads

  1. Replies: 9
    Last Post: 08-06-2011, 02:10 PM
  2. Capture data from TCP port
    By todster in forum Access
    Replies: 0
    Last Post: 07-19-2011, 12:22 AM
  3. Replies: 5
    Last Post: 01-15-2011, 01:35 AM
  4. Replies: 3
    Last Post: 08-08-2010, 05:33 PM
  5. Capture 2nd Value in an unbound Combo.
    By sesproul in forum Forms
    Replies: 5
    Last Post: 04-30-2010, 02:07 PM

Tags for this Thread

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