Click to See Complete Forum and Search --> : closing MDIChild forms


Jym
December 16th, 2002, 11:02 AM
is there a way to close all MDIChild forms without keeping track of the ones the user has open, leaving just the MDIParent form open?

DSJ
December 16th, 2002, 11:16 AM
Try something like this:

While not me.ActiveMDIChild is nothing
me.activemdiChild.Close
Loop

Athley
December 17th, 2002, 03:24 AM
or something like this....

Dim frm As Form
For Each frm In Me.MdiChildren
frm.Close()
Next

If you are not closing them from the parent window you will have to do something like this...

Dim frm As Form
For Each frm In Me.ParentForm.MdiChildren
frm.Close()
Next

/Leyan