473,808 Members | 2,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subreport visible property

ken
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![Main Report]!Subreport!Valu e = 0 Then
Me.Subreport.Re port.Visible = False
Else
Me.Subreport.Re port.Visible = False
End If
End Sub

Jan 3 '06 #1
5 10720
You could put the subreport into its own section in the main report, and
hide that section if needed. Or you could use the Format event of the Detail
section of the subreport to set the Visible property of the section (or
toggle its PrintSection and MoveLayout properties.)

But a *far* better idea would be to create the source query for this report
with criteria so that these values don't show up.

--
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.

"ken" <ge****@gmail.c om> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
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![Main Report]!Subreport!Valu e = 0 Then
Me.Subreport.Re port.Visible = False
Else
Me.Subreport.Re port.Visible = False
End If
End Sub

Jan 3 '06 #2
ken
Hi,
Thanks for your reply Allen,
I don't understand what you mean by
"But a *far* better idea would be to create the source query for this
report
with criteria so that these values don't show up."

I have a query that I use for this report...? In very rare cases this
query will have data, but not in certain columns which the report
reads. In this case I get a blank report except for the report Title in
the header and a subtitle in the detail section. I have a way to test
for the above scenario, and would like to make the header or the whole
report invisible...but so far no luck at manipulating the visible
property for the report or the header/detail sections.

Thanks

Jan 3 '06 #3
What are the conditions when you want the subreport to be invisible?

Could those conditions become the WHERE clause of the source query, so that
there is no data to show in the subreport? If so, that will solve the
problem, because the subreport does not print at all for those related
records that have no data.

--
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.

"ken" <ge****@gmail.c om> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Hi,
Thanks for your reply Allen,
I don't understand what you mean by
"But a *far* better idea would be to create the source query for this
report
with criteria so that these values don't show up."

I have a query that I use for this report...? In very rare cases this
query will have data, but not in certain columns which the report
reads. In this case I get a blank report except for the report Title in
the header and a subtitle in the detail section. I have a way to test
for the above scenario, and would like to make the header or the whole
report invisible...but so far no luck at manipulating the visible
property for the report or the header/detail sections.

Thanks

Jan 4 '06 #4
ken
no, I have 3 text fields along with 5 yes/no columns which when all
are false, the report needs to disappear...
so unfortunately I can't solve the problem this way.

Jan 4 '06 #5
So, in the query that supplies records to the subreport, include something
like this in the WHERE clause:
WHERE (([YesNo1] = True) OR ([YesNo2] = True) OR ([YesNo3] = True) OR
([YesNo4] = True) OR ([YesNo5] = True))

The records then disappear if all 5 yes/no fields are unchecked.

--
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.

"ken" <ge****@gmail.c om> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
no, I have 3 text fields along with 5 yes/no columns which when all
are false, the report needs to disappear...
so unfortunately I can't solve the problem this way.

Jan 4 '06 #6

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

Similar topics

8
13290
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
4901
by: CSDunn | last post by:
Hello, I currently have an Access 2003 ADP Report/Subreport set up in which I have 12 subreports in a single main report that are located in a group header called 'PermnumHeader' (Permnum would be the same as a numeric 'StudentID'). All subreports initially have their visible property set to 'No'. I have a macro that evaulates the current value of a field in the detail section of the main report called 'Grade' and a field in the same...
1
2380
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
2571
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
7459
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
2205
by: Tom | last post by:
I have a subreport that can contain one or two pictures per page. The subreport is similar to an appendix to the main report. The recordsource contains a field "IncludeInReport" (Yes/No) for each picture record. What code do I use and where does it go to prevent printing the subreport if there are no picture records marked "Yes" in the "IncludeInReport" field? Thanks, Tom
2
2112
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
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10373
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...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10113
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...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
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
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
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.