Hide one subreport if other has data

  • Thread starter Thread starter Lori
  • Start date Start date
L

Lori

I have a report that has two subreports and I know this should be simple but
basically, I'm having problems hiding one of the subreports.

If the first subreport has data it should be visible and subreport 2 should
be hidden. If subreport 1 has no data subreport 2 should be visible.

Subreport 1 is working fine, its invisible when there is no data and visible
when there is.
Subreport 2 however is always visible even tho the visible setting is set to
no.

HELP
 
Lori said:
I have a report that has two subreports and I know this should be simple but
basically, I'm having problems hiding one of the subreports.

If the first subreport has data it should be visible and subreport 2 should
be hidden. If subreport 1 has no data subreport 2 should be visible.

Subreport 1 is working fine, its invisible when there is no data and visible
when there is.
Subreport 2 however is always visible even tho the visible setting is set to
no.


Without seeing your code, it's alottle difficult to figure
out what might be wrong.

Try adding the code to the Format event procedure of the
main report section that contains the subreports:


Me.subreportcontrol1.Visible=Me.subreportcontrol1.Report.HasData
Me.subreportcontrol2.Visible=Not _
Me.subreportcontrol1.Report.HasData
 
Back
Top