Hello,
I have successfully used the NoData event for a report in the past, but now it's not working for me.
I have a series of forms that gather information from the user before displaying the report:
1) Date range criteria
2) Grouping Option (Day, Week, Month, Quarter, Year)
3) Show the graph (Y/N)
4) Show Detail, Show Summary
Sometimes the date range criteria will cause the report to not pull any records, I have the basic code for the NoData event:
But it doesn't seem to be firing. (I don't get the msgbox, and the report still opens.)
Does anyone know if the code I have in the "Open" event is somehow cancelling the NoData event?
The Open code processes the various report options such as changing the grouping expression, showing/hiding various report sections, and showing/hiding various graphs.
Thanks for any thoughts.
Heather
Ps. Any solution would ideally be carried out within the report, or would be general enough to be used for various reports, since my criteria forms are re-used for other reports in the database.
Floyd Innovations ![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)
I have successfully used the NoData event for a report in the past, but now it's not working for me.
I have a series of forms that gather information from the user before displaying the report:
1) Date range criteria
2) Grouping Option (Day, Week, Month, Quarter, Year)
3) Show the graph (Y/N)
4) Show Detail, Show Summary
Sometimes the date range criteria will cause the report to not pull any records, I have the basic code for the NoData event:
Code:
Private Sub Report_NoData(Cancel As Integer)
Dim msg As String
msg = "There are no records that match your choosen criteria, please change the criteria and try again."
MsgBox msg, vbOKOnly, "No Data to Display"
Cancel = True
End Sub
Does anyone know if the code I have in the "Open" event is somehow cancelling the NoData event?
The Open code processes the various report options such as changing the grouping expression, showing/hiding various report sections, and showing/hiding various graphs.
Thanks for any thoughts.
Heather
Ps. Any solution would ideally be carried out within the report, or would be general enough to be used for various reports, since my criteria forms are re-used for other reports in the database.
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)
![[yinyang] [yinyang] [yinyang]](/data/assets/smilies/yinyang.gif)