i have a MDI form and some individual forms(not child).
how do i code in the way that when i click to close/unload MDI form, all other opened forms all also closed.
Thank you
'Add following code to the MDIForm_Unload event
'This code unloads all forms in "Forms" collection of VB.
Private Sub MDIForm_Unload(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
'Unload each form but not the MDI until
'all others are unloaded.
If frm.Name <> Me.Name Then
Unload frm
Set frm = Nothing
End If
Next frm
'Now set the MDI form to nothing.
Set frmMDI = Nothing
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.