467,877 Members | 1,263 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

report/subreport questions

Ron
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
that? And also, if srptTwo is there and based on one of it's controls, is
also visible(there will be times when I'll want it not visible, even though
it's there)...can I change the visibility of the controls that are printing
out for srptOne based on what's on srptTwo, whether it's visible or not?
And if so, how?

TIA
ron
Apr 11 '07 #1
  • viewed: 1909
Share:
2 Replies
On Wed, 11 Apr 2007 02:50:00 GMT, "Ron"
<ro********************@verizon.netwrote:

Sure. Add a column (let's call it ColumnOne) to the query for the
recordsource of srptOne to indicate the count of records in the
related table used by srptTwo.

Then you can write in the Details.OnFormat event:
SomeControl.Visible = (ColumnOne <0)

-Tom.

>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
that? And also, if srptTwo is there and based on one of it's controls, is
also visible(there will be times when I'll want it not visible, even though
it's there)...can I change the visibility of the controls that are printing
out for srptOne based on what's on srptTwo, whether it's visible or not?
And if so, how?

TIA
ron
Apr 11 '07 #2
In srptOne, you have srptTwo in one of the sections (such as Detail.) In
that section, you can test the HasData property of the report in the
subreport control by putting an expression like this into the Control Source
of a text box:
=IIf([srptTwo].[Report].[HasData], "Yep", "Nothing there")

But remember that reports are forward scrolling only. They don't have a
current record. And the subreport could (at least theoretically) have
multiple records where the text box is visible in some rows and not in
others. Attempting to test the Visible property of a control in a subreport
in its parent report is therefore likely to be an exercise in frustration.

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

"Ron" <ro********************@verizon.netwrote in message
news:s1YSh.2484$Z66.9@trnddc06...
>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
that? And also, if srptTwo is there and based on one of it's controls,
is also visible(there will be times when I'll want it not visible, even
though it's there)...can I change the visibility of the controls that are
printing out for srptOne based on what's on srptTwo, whether it's visible
or not? And if so, how?

TIA
ron
Apr 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by David B | last post: by
1 post views Thread by last Name | last post: by
7 posts views Thread by Ellen Manning | last post: by
1 post views Thread by shaqattack1992-newsgroups | last post: by
3 posts views Thread by kenneth xg | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.