Form Closing Problem Help

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: ChrisP (ChrisP_at_discussions.microsoft.com)
Date: 08/24/04


Date: Tue, 24 Aug 2004 14:57:10 -0700

I setup my form with a close button which executes code that checks if there
is unsaved data on my form. If there is unsaved data it will not allow them
to close without saving.

However, the X at the top of the screen will bypass this check for unsaved
data. I tried putting the check in the Form Unload, but I had alot of errors
do to forms being open and the vbmodal errors. This was because the form
never unloaded it was still in the background. (1) How do you close the form
from the Form Unload?

the code works perfectly if it is in the Close command button. (2) How can I
do this check when the user clicks the X button, is this possible?

Please help me with my 2 questions and then give me suggestions. thanks
ahead of time.
Chris


Quantcast