利用报表的"无数据"属性,代码如下:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "当前报表无数据可显示。", vbInformation, "提示" Cancel = -1
End Sub