473,396 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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!Value = 0 Then
Me.Subreport.Report.Visible = False
Else
Me.Subreport.Report.Visible = False
End If
End Sub

Jan 3 '06 #1
5 10646
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.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.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!Value = 0 Then
Me.Subreport.Report.Visible = False
Else
Me.Subreport.Report.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.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.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.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.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
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...
3
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...
1
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...
7
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...
1
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...
3
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...
5
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...
2
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,...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.