Private Function NumberOfChildForms() As Long
Dim lngIndex As Long
Dim frmChild As Form
For Each frmChild In Forms
If frmChild.MDIChild Then
lngIndex = lngIndex + 1
End If
Next frmChild
NumberOfChildForms = lngIndex
End Function
--------------------------------------------------------------------------------