dbTalk Databases Forums  

Keeping empty subreport visible

comp.databases.ms-access comp.databases.ms-access


Discuss Keeping empty subreport visible in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bobh
 
Posts: n/a

Default Keeping empty subreport visible - 09-15-2005 , 04:47 PM






Hi All,
I have a report which has several sub-reports on it, Each sub-report
has its own record source and child/parent link.
Sometimes a sub-report may not have data for an entered policy nbr and
on the report thier is just an empty space where that sub-report would
be when that happens.

How do I get the sub-report to still display on the report when it has
no data????

I've tried putting code in the 'No Data' event of the sub-report but
that does not even get kicked-off when the underlining query has no
data.
thanks
bobh.


Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: Keeping empty subreport visible - 09-16-2005 , 02:56 AM






As you found the subreport prints nothing at all if the is no data in its
RecordSource.

If you still want its column headings to show even when there is no data to
print, the simplest option it to move the heading labels out of the
subreport, and onto the main report.

You can also do stuff like this in the Control Source of a text box on the
main report:
=IIf([Sub1].[Report].[HasData], Null, "Whatever you want to say.")
where Sub1 is the name of the subreport control.

If those ideas are not enough, you have to somehow get something into the
subreport's RecordSource. Changing the subreport's RecordSource to a UNION
query that contains at least one blank record would be one approach.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"bobh" <vulcaned (AT) isp (DOT) com> wrote

Quote:
Hi All,
I have a report which has several sub-reports on it, Each sub-report
has its own record source and child/parent link.
Sometimes a sub-report may not have data for an entered policy nbr and
on the report thier is just an empty space where that sub-report would
be when that happens.

How do I get the sub-report to still display on the report when it has
no data????

I've tried putting code in the 'No Data' event of the sub-report but
that does not even get kicked-off when the underlining query has no
data.
thanks
bobh



Reply With Quote
  #3  
Old   
bobh
 
Posts: n/a

Default Re: Keeping empty subreport visible - 09-16-2005 , 10:09 AM



Allen,
Yes, keeping the sub-report labels visible is exactly what I want to
do. Thanks for your suggestions, I'll give them a try.
bobh.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.