Dim fs: Set fs = CreateObject("Scripting.FileSystemObject")
Dim tso: Set tso = fs.OpenTextFile("C:\xxx\AllFormsControls.txt", 2, True)
Dim ct As DAO.Container
For Each ct In CurrentDb.Containers
If ct.Name = "Forms" Then
Dim doc As DAO.Document
For Each doc In ct.Documents
Debug.Print doc.Name
tso.WriteLine ""
tso.WriteLine "画面名" & vbTab & doc.Name
DoCmd.OpenForm doc.Name, acDesign, , , , acHidden
Dim frm As Form: Set frm = Forms(doc.Name)
tso.WriteLine "RecordSource" & vbTab & frm.RecordSource
tso.WriteLine "Type" & vbTab & "名称" & vbTab & "Source/Caption"
Dim obj As Control
For Each obj In frm
Select Case TypeName(obj)
Case "TextBox", "ComboBox", "ListBox"
tso.WriteLine TypeName(obj) & vbTab & obj.Name & vbTab & obj.ControlSource
Case "Label", "CommandButton", "OptionGroup", "ToggleButton"
tso.WriteLine TypeName(obj) & vbTab & obj.Name & vbTab & obj.Caption
End Select
Next
DoCmd.Close acForm, doc.Name
Next doc
Exit For
End If
Next
tso.Close
Set tso = Nothing
Set fs = Nothing