> But it (it being QueryUnload) does not fire if you call THISFORM.Release.
Its important to point that out. That is the reason Jockey suggested adding a separate user defined method to check, whether conditions are met to close the form or not and calling (quite like asking) that method from both QueryUnload and Release.
One more thing to it: Before QueryUnload is called the form property ReleaseType is set and you can determine what caused QueryUnload. Eg in your case of clicking the close button or close menu command it's 1, in case the form is released by releasing a variable holding the (only/last) form reference, the value is 0 and in case Foxpro exits, which rather means windows is shutdown, the value is 2.
It's important to not, because this is a form property otherwise useless, its value only is of importance in the QueryUnload. It's a design error to not make this a QueryUnload event parameter, because that makes it very unobvious, there is info about the closing reason.
The reason for Release always is just one: It was called - it never happens automatically. So in the release method you can assume your form is closed by your own code and you want the form to close. The OK2Destroy check, as Jockey names it, could also be done outside of Release, that's a matter of taste, but it makes sense to do as Jockey suggests, as you then react in the central two methods/events for form closing and channel these into one central method. There also is the closable property you might set, but that disables the close button, which is not what you want. Again a matter of taste.
The importance of Thisform.ReleaseType is, if its value is 2. You typically then don't want to prevent a windows shutdown, actually you can't relay or prevent it forever. Current Windows versions then ask the user, if he wants to shutdown anyway and depending on settings Windows even shuts down, if the user doesn't react. Also in case of notebooks the emergency shutdown happening on low battery always will occur. So you better react to that QueryUnload in a automatic save or revert (what suits you better) and close.
Bye, Olaf.