The problem I am having is when I execute a report with no data, I get a blank report. So i implemented on the "no data event" on the report a message box and then a process to kill the action and return to the form. This works flawlessly on my developer edition but when it is actually run on a users machine using the access runtimes it gets an error and exits the database.
Therefore on the form that calls the report, I would like to run the qry first, check for data and if there is no data use a msgbox to say no data and that would be it, there would be no report calling involved unless the qry returned data.
There is the qry I run for the report. How do I run that qry on a form, check for data, if there is no data return a msgbox else if there is data call the report as I would and display it normally.
Thanks!
Therefore on the form that calls the report, I would like to run the qry first, check for data and if there is no data use a msgbox to say no data and that would be it, there would be no report calling involved unless the qry returned data.
Code:
qry = "SELECT Issues.MILESTONE, TBL_MILESTONES.MILESTONES, Issues.[Status Code] AS "
qry = qry & "[Status Code1], Count(Issues.IssueNumber) AS [Total Of Status Code] "
qry = qry & "FROM Issues INNER JOIN TBL_MILESTONES ON Issues.MILESTONE = "
qry = qry & "TBL_MILESTONES.MILESTONES_ID "
qry = qry & "GROUP BY Issues.MILESTONE, TBL_MILESTONES.MILESTONES, Issues.[Status Code] "
qry = qry & "HAVING (((Issues.MILESTONE)= " & MilestoneValue & " ));"
Thanks!