Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2006

Tip: Looking for answers? Try searching our database.

Some subreports hidden when no data, others visible!?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kjell Harnesk - 16 Jan 2006 21:00 GMT
I have a report with 5 subreports. I believed I had built them from the
same template but one of the subreports show up in the report even if it
has no data. The others don´t. Is there a setting for this or what else
have I missed.

Another thing is that I have a control on the main report that sums a field
in each subreport. but it fails when there is not data in all the subs.
Tried Nz but of course that failed, seems like the subreports does not
exist when they have no data rather than being hidden. How do I solve it so
that the control sums those fields that have data and skips those who
don´t?
Signature

Kjell Harnesk

Marshall Barton - 16 Jan 2006 22:23 GMT
>I have a report with 5 subreports. I believed I had built them from the
>same template but one of the subreports show up in the report even if it
[quoted text clipped - 7 lines]
>that the control sums those fields that have data and skips those who
>don´t?

Subreports with no data do not display, so yours must have
some data, even if its fields are all empty.  Try opening
the report's record source table/query in sheet view and
looking for an empty record.

You're right about subreport's not existing when they have
no data.  You can test for this condition in a main report
text box with something like:

=IIf(subreport.Report.HasData, subreport.Report.totalbox, 0)

Signature

Marsh
MVP [MS Access]

Kjell Harnesk - 17 Jan 2006 19:17 GMT
> Subreports with no data do not display, so yours must have
> some data, even if its fields are all empty.  Try opening
> the report's record source table/query in sheet view and
> looking for an empty record.

It had no empty records, it did not even dissapear when I removed all the
fields from the sub so it could not possibly have any data. Well I was kind
of stuck so in desperation I created a new subreport with the same content
and it works OK. Something must have been corupt in the first one.

> You're right about subreport's not existing when they have
> no data.  You can test for this condition in a main report
> text box with something like:
>
> =IIf(subreport.Report.HasData, subreport.Report.totalbox, 0)

This worked perfectly, thanks!
Signature

Kjell Harnesk

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.