Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    2

    Unanswered: Form_Load Event called on Application quit

    Hello,

    I am having problems when I exit my application.

    I have a form that opens when a menu item is clicked. In this form's Load Event, I have DoCmd that "pops up" another form, for filtering the selection. This pop up form is also modal.

    Now, once I have made the selection in the pop up form, my pop up closes.

    Finally, when I still leave the first form open, and exit the application by hitting the "x", the Form_Load event is getting called again. This pops up the selection form which is modal!

    Now, since the application is terminating, it does not let me pick anything or close out of the pop up form, leaving Access running, but unfrozen. Its like a splash screen that won't go away. The only option is to End Task through Task Manager, even though the application does not say "Not Responding"

    I hope this makes sense. Please let me know if anyone has a solution to this, or has come across this problem.

    I do not get this problem in Acces 2002 or 2003. This happens only in 2007 and 2010.

    Any input is appreciated.

    Thanks,
    Vijay

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    sounds like you've isolated it to the form load event firing.....which is odd.

    assuming you've done a compact/repair....and assuming you have temporarily deactivated that vb as a sanity check to see the app close ok - and that there is truly no code in the form close event....

    then maybe you can do a work around to take away the x - and have the application quit event fire from a command button in which you can then better control code that fires...

  3. #3
    Join Date
    Jun 2010
    Posts
    2
    Thanks for the reply. I have a work around, but I was curious as to why this was happening in the new versions.

    I have an application quit button also, but it causes the same issue as the "x" does.

    I would rather avoid the work around, as I would have to change code in about 30 forms that have the same issue.

  4. #4
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by gsva1983 View Post
    Thanks for the reply. I have a work around, but I was curious as to why this was happening in the new versions.

    I have an application quit button also, but it causes the same issue as the "x" does.

    I would rather avoid the work around, as I would have to change code in about 30 forms that have the same issue.

    I have seen this happen in versions Access 97 to 20010.

    On newer PCs with Access 2007/2010 the execution speed is so much faster that there appears to be timing issues. I have seen where events are not used properly, they still working on older versions prior to 2007.

    I have found that it is very important to close all modal and hidden forms before attempting to exit Access. I saw this issue even with the Access 97 in runtime mode.

    I use a little VBA code that in my main menu/switchboard the prevents Access from closing unless the "Exit" button has been clicked. The "Exit" button also closes all other open forms before closing and quitting Access.

    This seams to have solved the issue in all versions of Access.


    Edit:
    Curious, what is your workaround?
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

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
  •