0

使用 MS Access VBA 以下代码适用于我:

Reports.PARENT_REPORT_NAME.CHILD_REPORT_NAME.Report.Label1.Caption = "Yes"

但是,这不会:

With Reports(PARENT_REPORT_NAME)
.CHILD_REPORT_NAME.Report.Label1.Caption = "Yes"

请问有人对我有任何见解吗?

4

1 回答 1

0

考虑允许对象名称的字符串引用的Reports集合和Report.Controls属性:

With Reports("PARENT_REPORT_NAME")                
   .Controls("CHILD_REPORT_NAME").Report.Label1.Caption = "Yes"
   ...
End With
于 2018-06-20T20:11:22.420 回答