How can I enum child forms?

  • Thread starter Thread starter Bodi Klamph
  • Start date Start date
B

Bodi Klamph

Hi

I would like a programmatical way of enumerating the child forms that are
open.

I have a function that refreshes all the comboboxes that are linked to SPs,
but I am unable to requery the subforms because they aren't listed in the
Forms collection. I could create a function that calls the Forms public
method that then requeries the subform by name, but I would prefer to have a
generic method.

Help?

Thanks,
Bodi
 
Hi,
Here you go:

Public Sub EnumerateSubforms()
Dim frm As Form
Dim ctl As Control

On Error Resume Next
For Each frm In Forms
For Each ctl In frm
If ctl.ControlType = acSubform Then
MsgBox ctl.Name
End If
Next ctl
Next frm
End Sub
 
Back
Top