Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sub Report blank when no data? 2

Status
Not open for further replies.

ordendelfai

Technical User
Nov 8, 2002
187
US
I have a sub report on a master report that is not linked (independent). The sub report has a group header that prints with the data on the master report when their is data in the sub report. When there is no data in the sub report however, nothing prints at all. I need the group header to still be visible even when there is no data in the sub report.

I have played around with the OnOpen, OnFormat and OnPrint of the master report by entering the below code to try to force the sub report to always be visible with no luck:
Code:
MySubReport.Visible = True

Anyone have some tips to force the group header to be displayed?

~Orden
 
You can't make a subreport appear if there are not records in the subreport's record source. If you want to extract a value from a subreport regardless of the number of records (or 0) then you have to use an expression like:

=IIf(subrptCOntrol.Report.HasData, subrptControl.Report.txtGroupTotal, 0)


Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Hi Duane,

I spent about 1 1/2 hours going through threads like this and you where in all of them spanning about 2 years!! ;-)

I tried everything to prove you wrong, but I finally agree, it's not possible. I ended up using the HasData value from past posts you have made to handle getting values from the sub reports, and am just dealing with the fact that my group headers are gone (I'll probably use a dirty solution with headers on the main when necessary, but it will look slightly off).

It's lame that Access doesn't have a way to force the group headers to stay, but oh well, it can do just about anything else I need.

Thanks for the tips (and all the others!)

Joel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top