You are close. Try:
Set frm = Forms.Item(strTemp)
or even shorter
Set frm = Forms(strTemp)
(since Item is the Default Property of Forms).
BTW, please use PlainText for posting as PlainText is faster for everyone to
download. Also, check you PC date, you are 1 day too early. Lots of
potential responders won't reply to post-dated questions. Check the
netiquette available from:
http://www.mvps.org/access/netiquette.htm
HTH
Van T. Dinh
' I am trying to list all the controls on all of the forms on a database
' I am inserting the name of the form; its caption and the control name and
control tip text properties in a table
' my problem is with the inner loop of my function
' frm has to be a form in order to get the desired results
' Any tips? problems marked in red; thanks
Function DisplayFormInformation()
Dim frm As Form
Dim strObject As String, aob As AccessObject, obj As Object
Dim strTemp As String, strList As String
Dim strTempForm As Variant
Dim myObject As Object
Dim k As Long
Dim frmControl As Control
Dim frmControls As Controls
Dim ConnectToDB As New ADODB.Connection
Set ConnectToDB = CurrentProject.Connection
Dim rTarget As New ADODB.Recordset
rTarget.Open "ObjectDocumenter", ConnectToDB, adOpenKeyset, adLockOptimistic
Set obj = CurrentProject.AllForms
On Error Resume Next
For Each aob In obj
strTemp = aob.Name
DoCmd.OpenForm strTemp, acDesign
strTempForm = "forms!" & strTemp
Set frm = strTempForm
For Each frmControl In frm.Controls
rTarget.AddNew
rTarget("FormName") = strTemp
rTarget("FormCaption") = Eval("forms!" & strTemp &
".caption")
rTarget("ObjectName") = frmControl.Name
rTarget("ControlTipTextValue") =
frmControl.ControlTipText
rTarget.Update
Next frmControl
DoCmd.Close acForm, strTemp
Next
rTarget.close
ConnectToDB.close
End Function