There are several ways to do this. Here is one:
Code:
Private Sub mnuCloseAll_Click()
Do Until MDIForm1.ActiveForm Is Nothing
Unload MDIForm1.ActiveForm
Loop
End Sub
This assumes your menu item is named mnuCloseAll, and your MDIForm is named MDIForm1.
Each time you delete a active child form, the next one becomes the active one, so looping through each form this way works. When there are no more child forms, there is no MDIForm1.Activeform and the loop terminates.
Woody Z
http://www.learntoprogramnow.com