Accessing/Updating controls in multiple mdi children

jaeman

Member
Joined
Jul 15, 2004
Messages
10
Location
Australia
Programming Experience
1-3
Not sure how to do this, so i'm hoping someone will enlighten me as to how to do it.

What i have is a mdi container with say several child forms, each child form is given a different form name on creation.

I understand how to check if the item exists and make it the active form but i can't update data to the controls on that mdi child.

Any help would be greatly appreciated, Jaeman...
 

jaeman

Member
Joined
Jul 15, 2004
Messages
10
Location
Australia
Programming Experience
1-3
All fixed...

For Each frmTest In Me.MdiChildren
With frmTest
If .Name = strFormName Then
' Form Found So Access Control
.Controls(0).Text = "UPdate this text"
.Controls(1).Text = "Update This aswell"
Exit Sub
End If
End With
Next

By using a for each statement you can list the controls in the order they appear within a child form, something like this within the "form found" IF statement

'Dim con As Control
'Dim s As String
'For Each con In .Controls
' s += con.Name.ToString & vbCrLf
'Next
'MsgBox(s)

Listing the controls to then work with on any given child form... jaeman
 
Top Bottom