Form_Unload vs Form_QueryUnload

Posted on 2006-05-30
Last Modified: 2007-11-27
What is the difference between Form_unload and form_queryunload in laymens terms?

I am about to print a message if any changes have been made to a form and not saved?  

I can see that the form_queryunload gets called before the form_unload, but for saving and cancelling functionality for
the form the two events look the same.

Question by:swansonplace
    LVL 52

    Assisted Solution

    by:Carl Tawn
    Basically Unload is called when the form is being unloaded, whereas QueryUnload runs just before the form unloads. QueryUnload runs first and gives you the opportunity to stop the form unloading.
    LVL 85

    Accepted Solution

    They BOTH give you the opportunity to cancel the closing of the form...

    The difference is that QueryUnload() provides you with extra information about HOW the form closing was initiated.


    Author Comment

    Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now