如何检索 MS-Access 数据库中所有表单的列表?
要检索所有表的列表,我使用以下命令:
For Each TDef In CurrentDb.TableDefs
If Left(TDef.Name, 4) <> "MSys" And Left(TDef.Name, 7) <> "~TMPCLP" Then
Debug.Print TDef.Name
End If
Next
另请参阅this issue .
但我不能对表单执行此操作。
最佳答案
您可以使用 AllForms 来获取姓名列表。这些不是表单的实例,只是名称。
Sub ListForms()
Dim frm As Object
Dim LiveForm As Form
For Each frm In CurrentProject.AllForms
Debug.Print frm.Name
''To use the form, uncomment
''DoCmd.OpenForm frm.Name, acViewDesign
''Set LiveForm = Forms(frm.Name)
''Do not forget to close when you are done
''DoCmd.Close acForm, frm.Name
Next
End Sub
关于ms-access - 检索 Access 数据库中的表单列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11576352/