0
我有一個嵌入到包含文本框和按鈕的表單中的報表。MS Access,刷新嵌入到表單中的報表
我的願望是更新報表上的過濾器並重新查詢並刷新表單中的報表。我對訪問中使用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'? – Aiken 2014-09-08 08:14:44