Hi All,
I'm sorry to raise this issue again, it seems to come around every 6 months or 
so, but although I understand *how* it's done and *why* it needs to be done 
this way, and I've done it correctly (I hope!) hundreds of times, the more I 
think that I don't really understand why it actually works.  I think that I've 
tended to accept that it does work without really thinking about how it works.

I am of course talking about exiting/ending/closing call it what you will, an 
application. I understand that the way to do it is to unload all the forms, set 
any references to them and all loaded objects = Nothing and finally exit.  
However (and I'll give a really simple example), assuming we start the app from 
Sub Main, that shows a form that waits for a button to be clicked, and when 
that happens it unloads the form and exits.  But how is that possible?  I know 
from bitter experience of having a shutdown sub in a common module that this 
doesn't work - if the sub is called from the form (which directly or indirectly 
it must be), and that sub unloads the form, and even sets it = nothing, then it 
must then exit back to the form and the form is reloaded and the app doesn't 
end.  By that same mechanism, if in the command button click module I put, 
Unload Me, Exit Sub, how does that end the app?  The Exit Sub statement is part 
of the Form, in order to execute, some reference to it (and therefore to the 
form) must exist and so why does the app end?

Following on from that, is there really any way to correctly shut down from a 
common routine in a module?  If there is then I can't find it!

Ian

[Non-text portions of this message have been removed]




'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [email protected]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to