VBAのCode
Access Access VBA reference オブジェクト モデル Report オブジェクト (Access)
Report_NoData
Private Sub Report_NoData(Cancel As Integer)
'Add code here that will be executed if no data
'was returned by the Report's RecordSource
MsgBox "No customers ordered this product this month. " & _
"The report will now close."
Cancel = True
End Sub
これを書くレポートごとにNo Dataイヴェントに書けと。
レポートの NoData イベントを使用して、表示するデータがないときにレポートを開かないようにする方法を示します。