Prevent Preview of Report if no records found

P

phuser

If there is no data in the report is there a way a pop up can occur stating
No data to report and preventing that report from previewing?
 
J

Jeff Boyce

Take a look at the NoDate property of the report in design view... Add your
code there.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
P

phuser

What if it is a report that has 2 subreports and 1 of the reports does not
contain any data, is there a way to stop the parent report?
 
P

phuser

I was able to get by browsing the web,

If Me.HasData = 1 And [SubreportName].Report.HasData = 0 Then
MsgBox "There is no data"
DoCmd.Close
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top