|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Easy questionForm2 has cmdCancel button: Public Sub cmdCancel_Click() Call EndAll ===> this call unloads Form1 Unload Me End Sub Form1 Unload event: Private Sub Form_Unload(Cancel As Integer) Dim f As Form For Each f In Forms Unload f Next End Sub Clicking on cmdCancel causes the application termination. My question is: Why Form2 does not go through Form_Unload (for the second time)? Is that always true? If the form is unloaded Unload Me does not affect anything? Thanks, Jack "Jack" <replyto@it> wrote in message Correct.news:ulNQTZ$KIHA.1324@TK2MSFTNGP06.phx.gbl... > If the form is unloaded Unload Me does not affect anything? "Jack" <replyto@it>'s wild thoughts were released on Tue, 20 Nov 2007 23:23:52 -0500 bearing the following fruit:Show quoteHide quote >2 forms: Form1 and Form2 My question would be why is the form unload there at all. It> >Form2 has cmdCancel button: >Public Sub cmdCancel_Click() > Call EndAll ===> this call unloads Form1 > Unload Me >End Sub > >Form1 Unload event: >Private Sub Form_Unload(Cancel As Integer) >Dim f As Form > For Each f In Forms > Unload f > Next >End Sub > >Clicking on cmdCancel causes the application termination. > My question is: >Why Form2 does not go through Form_Unload (for the second time)? Is that >always true? >If the form is unloaded Unload Me does not affect anything? >Thanks, >Jack > only confuses anyone reading the code. It implies EndAll doesn't close this particular form. -- Jan Hyde https://mvp.support.microsoft.com/profile/Jan.Hyde |
|||||||||||||||||||||||