terpsichore
asked on
Subreport - make invisible in Report View
Dear experts -
I have a subreport which I would like to make invisible if it contains no records - it does this OK in Print Preview, but NOT in Report View.
Any ideas?
Thanks!
I have a subreport which I would like to make invisible if it contains no records - it does this OK in Print Preview, but NOT in Report View.
Any ideas?
Thanks!
Put a textbox in the header or footer of your subreport and in its ControlSource insert this:
=Count (*)
Let's call it txtCount. Then in the OnLoad event of your report, add this:
Me.NameOfSubreportControl. Visible = (Me.NameOfSubreportControl .Report!tx tCount > 0)
ASKER
i want the subreport to be visible or not depending on the value of the parent record.
For example, we have:
Project 1
- subreport may be visible or not
Project 2
- subreport may be visible or not
Project 3
- subreport may be visible or not
Will this work in that case?
For example, we have:
Project 1
- subreport may be visible or not
Project 2
- subreport may be visible or not
Project 3
- subreport may be visible or not
Will this work in that case?
Looks like you have this subreport in the Detail section. Normally you would put the code in the OnFormat property of the Detail section; however, this will only work in Print Preview and when printing the report. It will not work in Report View.
ASKER
there is no workaround?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
extremely thorough. thanks.