Skip printing a report record if a subreport data has no records

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

I have a report that has one subreport. I would like to
skip printing a report record if there is no data in the
subreport(no records in the subreport but there is report
main section data). Is there a way to accomplish this?
Thanks.

Dennis
 
To remove the record from the main report's RecordSource, you need to create
a query that combines the main report's table(s) and the subreport's
table(s). The INNER JOIN in the query means that any main report record that
has not subreport record is suppressed.

Once you have done that, it may be easier to put everything in the main
report, and drop the subreport. Using the Sorting And Grouping box (View
menu in report design view), create a Group Header for the main report
things that should appear above the "subreport", and a Group Footer for what
should appear below it. Since the subreport's data is now in the main
report's RecordSource, you can just put the data directly into the Detail
section of the main report instead of needing a subreport. (There may be
reasons why that's not desirable, but it is the simplest approach.)
 
Back
Top