hi everyone,
I am using a MDI form which contains many childs. I want to execute a certain code "only if the child is individually close". And I dont want that executed if the main MDI form is closed. I tried putting a boolean global variable in the MDI_Unload and MDI_Terminate events. And checking the boolean at the form_unload event of child, still the code executes.
Example:
Private Sub MDIForm_Terminate() 'In Main Form
CloseAllTabs = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Not CloseAllTabs Then MsgBox Me.Caption
End Sub
the message box pops up everytime. Even if MDIForm is closed. Help me.
thanks in advance.
I am using a MDI form which contains many childs. I want to execute a certain code "only if the child is individually close". And I dont want that executed if the main MDI form is closed. I tried putting a boolean global variable in the MDI_Unload and MDI_Terminate events. And checking the boolean at the form_unload event of child, still the code executes.
Example:
Private Sub MDIForm_Terminate() 'In Main Form
CloseAllTabs = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
If Not CloseAllTabs Then MsgBox Me.Caption
End Sub
the message box pops up everytime. Even if MDIForm is closed. Help me.
thanks in advance.