Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NoData Event not firing?

Status
Not open for further replies.

HFloyd

Programmer
Jun 5, 2002
71
US
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:
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
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.




[yinyang] Floyd Innovations [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top