Click to See Complete Forum and Search --> : MDI Forms


Andy Guru
August 5th, 2000, 03:50 AM
I am using a MDI form with abt 35-40 child forms.
Now, is there any way in which i can cycle thru all the child forms in a MDI?..just like we do for cyclin thru all the controls in a form..for example

for Each ctl In Controls
If TypeOf ctl is ComboBox Or TypeOf ctl is TextBox then
If ctl.Text = "" then
nullcheck = 1
' MsgBox "empty field not allowed" + ctl.Name
Exit Function
End If
End If
next



similary do we have anythin by which we can cycle thru all the forms?..pls reply asap..
I am aware that we can cycle thru all the ActiveForms in the MDI using the ActiveForm property...but i want to cycle thru all the forms irrespective of whether its active or not..
thanx

Aaron Young
August 5th, 2000, 01:45 PM
You can use the Forms collection, but the Forms do have to be loaded:private Sub Command1_Click()
Dim oForm as Form
for Each oForm In Forms
If Not TypeOf oForm is MDIForm then
If oForm.MDIChild then oForm.Caption = ""
End If
next
End Sub



Aaron Young
Analyst Programmer
ajyoung@charter.net
Certified AllExperts Expert: http://www.allexperts.com/displayExpert.asp?Expert=11884