Do not show main record if sub reports null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I've created a main report with two sub reports which work OK except that
where there are no sub-reports associated with a record, it will not ignore
that record and prints it along with a blank space where the sub-reports
would be.
I would like to show in the report only those records which have entries in
one or both sub-records.
Also, although I've set the various sections to Allow for Shrink or Expand,
where there is nothing in a sub-record the minimum space it would occupy (one
line for one record)remains - thus leaving a lot of unnecessary white space
on the report.
Any help would be much appreciated.
Thanks
 
ancient_hilly said:
Hi, I've created a main report with two sub reports which work OK except that
where there are no sub-reports associated with a record, it will not ignore
that record and prints it along with a blank space where the sub-reports
would be.
I would like to show in the report only those records which have entries in
one or both sub-records.
Also, although I've set the various sections to Allow for Shrink or Expand,
where there is nothing in a sub-record the minimum space it would occupy (one
line for one record)remains - thus leaving a lot of unnecessary white space
on the report.


You can check the subreport's HasData property to determine
if they don't have any entries.

In the detail section's Format event procedure:

Cancel = Not (Me.subreport1.Report.HasData _
Or Me.subreport2.Report.HasData)
 
Thank you. The white spaces have been removed. The only remaining niggle is
the header (name of organisation) for those records where there is nothing to
show in either of the sub-reports still lists itself. If you have any
thoughts on how to remove these I would be very grateful.

Incidentally, in order to allow for expansion, without one sub-header
writing on top of the other, I had to put one sub-header in the footer for
the section, with the other in Detail.
 
Back
Top