how do I code the app to ask if they would like to save when they close with the (x). as well, sometimes when I close it seems as if things are still running - is there a command to ensure the app quits running? thanks
Printable View
how do I code the app to ask if they would like to save when they close with the (x). as well, sometimes when I close it seems as if things are still running - is there a command to ensure the app quits running? thanks
Add a routine to a code module that 1) unloads all your forms, 2) sets them all to Nothing and 3) End. You should call that routine from your main form's Exit button (I assume you have one) and from your main form's Unload sub.
(1) you may want to add code to the _Unload() event of your form. you could ask them at that point if they want to save before leaving, as well as setting the Cancel parameter to true if you want to abort the exit operation.
(2) make sure that all the objects you instantiated are dereferrenced. that means you would .Unload all the forms your application has opened, and you would set to Nothing all the instances of the other objects you have used. get used to declare your objects with their proper scope and VB will do most of this stuff for you.
thanks - got things fixed