Hide one subreport if other has data

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
 
M

Marshall Barton

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
 

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