VBA:表单中的记录源列表
我想扫描到 ADP 表单中的所有 RecordSource。我的其中一个表单可能会调用错误的视图。它通常在 RecordSource 属性中设置。问题是我的 ADP 中有大约 300 多个表格。所以我想打印每个表单中的所有 RecordSource 以便能够找到并纠正问题。这是我到目前为止所做的事情。
Private Sub Command1_Click()
Dim sForm As String
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
Dim cCount As Long
cCount = 0
For Each obj In dbs.AllForms
' Print name of obj.
sForm = "Form_" & obj.name
Debug.Print cCount & " " & Forms(sForm)!RecordSource
cCount = cCount + 1
Next obj
End Sub
错误是 Access 找不到 Form。运行时错误“2450”。
I want to scan to all RecordSource in my ADP Forms. One of my Form might call in the wrong View. It usually sets in RecordSource Property. The problem is there are about 300+ forms in my ADP. So I want to print all RecordSource in each form in able to find and correct the problem. Here are what I did so far.
Private Sub Command1_Click()
Dim sForm As String
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
Dim cCount As Long
cCount = 0
For Each obj In dbs.AllForms
' Print name of obj.
sForm = "Form_" & obj.name
Debug.Print cCount & " " & Forms(sForm)!RecordSource
cCount = cCount + 1
Next obj
End Sub
The error is Access can't find Form. Run-Time Error '2450'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许:
Perhaps: