retrieve the name of all subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm using a form that includes many subforms.
What I would like to do is to update the subform's functions after changing
a value in a combobox that is in the mainform.
To do that I would like to retrieve the name of all subforms, so I can call
the subform's functions with a "For each" cycle...
Any ideas?

Thanks in advance
 
Tiago said:
I'm using a form that includes many subforms.
What I would like to do is to update the subform's functions after changing
a value in a combobox that is in the mainform.
To do that I would like to retrieve the name of all subforms, so I can call
the subform's functions with a "For each" cycle...


I think this is the kind of thing you're looking for:

For Each ctl In Me.Controls
If ctl.ControlType = acSubFOrm THem
result = ctl.Form.function(args)
End If
Next ctl

Make sure the functions are declared as Public.
 
Pseudocode:

For Each C in MyForm.Controls
If C.Type = acSubform Then
With C.Form
do stuff
End With
End If
Next
 
Thanks guys....

That did the trick...




John Nurick said:
Pseudocode:

For Each C in MyForm.Controls
If C.Type = acSubform Then
With C.Form
do stuff
End With
End If
Next
 
Back
Top