473,799 Members | 2,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Keeping empty subreport visible

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.

Nov 13 '05 #1
2 11759
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" <vu******@isp.c om> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
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

Nov 13 '05 #2
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.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
13285
by: dixie | last post by:
I have a report with a subreport. The source object for this subreport varies according to the value of a field in a table. I am trying to programmatically set the object source for the subreport as part of the detail format section of the report. I have been playing around with things like: Me.SubReport.SourceObject = Report.sub5O5L but nothing seems to work. Can I achieve what I want to do and if so, can anyone give me the...
3
1962
by: John M | last post by:
Hi, I've set up a sytem in our school for writing reports. It uses Access ... and does a fine job! My problem comes with printing. Each subject produces a report consisting of a series of coded data, levels, targets etc, then text from a memo field. Different staff write different amounts in the memo field. As a result I keep getting odd reports split over a page.
1
2379
by: last Name | last post by:
Hello all, I'm using Access 2000. I have a subreport control which loads a report in the detail section of a main report. I need to keep a count of each item price in the subreport and place it in the Report footer of the main report. Each post i've read on this seems to not work and/or give me the same problems the other posters are having: a box coming up asking for parameter values. Thanks in advance for your help.
7
3574
by: Ellen Manning | last post by:
I've got an A2K report showing students and their costs. Student info is in the main report and costs are in a subreport for each student. The user inputs the program desired then only those students in that program are printed. I want the subreports headings to print only for the first student on the page. Is there a way to suppress printing of the headings on subsequent students on that page? I tried the following in both the...
1
2570
by: Jordan Fee | last post by:
I'd like to perform some conditional formatting in the OnFormat Event of my Parent Report. This works fine, until my subreports are blank, then the invalid references start happening. I understand why, but can't figure out how to trap/prevent these. I tried using the hasdata property, but this also gives me an invalid reference. Arrrrrgh.
3
7458
by: kmacon | last post by:
I have a form that contains a command button. The command button's OnClick event builds a report using the CreateReport and CreateReportControl functions and then opens the main report. I set the OnFormat property of the detail section in the subreport to a function which is located in a standard module. I am not able to access the subreport nor it's controls in the module. I need to hide a text box in the subreport if there is no...
5
10719
by: ken | last post by:
Hi, Why can't I do this in the report activate section of my main report? I have a main report, and a subreport on it. The idea is that if the subreport has a certain value in a control within it, I want to hide the subreport. I get an error(runtime 2101 the setting you entered isn't valid for this property) for the line of code below Private Sub Report_Activate() If Reports!!Subreport!Value = 0 Then Me.Subreport.Report.Visible = False
2
2111
by: Ron | last post by:
I have a report let's call rptOne. On rptOne I have a subreport called srptOne. On srptOne I have a subreport called srptTwo. Sometimes, srptTwo is there and shows it's data and sometimes not, based on whether there is data in the query/table that srptTwo is based on of course. All works fine. However, now I'd like to control whether certain fields are visible on srptOne based on whether srptTwo is there or not. Is there a way to do...
1
3347
by: pdm | last post by:
hoi access, I have a subreport and with the id of inheritance of OOP I like to reuse this subreport in other main reports and hide some fields. First, is this possible and second what is the correct syntax. I tried many combinations but error on syntax. first I create a MainReportFeedMainReports with only one subReport where 5 fields are not visible. I need the correct syntax to say on the event Open
0
10473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10249
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10025
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6804
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.