【发布时间】:2014-09-05 21:31:38
【问题描述】:
我在包含文本框和按钮的表单中嵌入了一份报告。
我的愿望是更新报表上的过滤器并在表单中重新查询和刷新报表。我对在访问中使用 VBA 不是很熟悉,所以我很可能完全不了解我尝试这样做的方式。
点击 generateExhib 按钮时触发的事件如下。
作为子表单/子报表嵌入的报表名为 TagReport。
Private Sub GenerateExhib_Click()
If (generatePrintedExhib.Value = False) Then
Me.TagReport.Application.DoCmd.SetFilter WhereCondition:="[Exhibitor ID] =" + ExhibitorNumber.Value + " AND [UDEntry-CheckBox1] = false"
Else
Me.TagReport.Application.DoCmd.SetFilter WhereCondition:="[Exhibitor ID] =" + ExhibitorNumber.Value
End If
Me.TagReport.Report.Application.DoCmd.Requery
Me.TagReport.Report.Application.DoCmd.RefreshRecord
End Sub
【问题讨论】:
-
不确定是不是罪魁祸首,所以我将把它作为评论发布,但你为什么要经历
Me.TagReport.Report.Application.DoCmd.Requery的整个麻烦而不是Me.TagReport.Requery?
标签: ms-access vba ms-access-2013