Stephen Bond
stephen at bondsoftware.co.nz
Thu Jul 31 19:45:01 CDT 2003
I am trying to document the subforms embedded in a Tab Control. I have got what I want, as far as the commented lines below. What is the syntax for looping thru all the controls on a acPage type control, testing if each is a sub-form and documenting as below?
Anyone?
Stephen Bond
<code>
For Each doc In cont()
DoCmd.OpenForm doc.Name, acDesign
With Screen.ActiveForm
rs.AddNew
rs!FormName = VBA.Left(doc.Name, 50)
rs!ControlName = "__ F o r m"
rs.Update
For Each ctl In .Controls
If ctl.ControlType = acPage Then
rs.AddNew
rs!FormName = VBA.Left(doc.Name, 50)
rs!ControlName = VBA.Left(ctl.Name, 50)
rs!ControlSourceObject = VBA.Left(ctl.SourceObject, 100)
rs.Update
' For Each control on the tab page (which is itself a control)
' if it is a subform, I want to extract
' the Name and the SourceObject properties
'
' Next
End If
Next ctl
End With
DoCmd.Close , , acSaveNo
Next doc
</code>
Stephen Bond