Reference a Control on a Nested Subform

G

Guest

I would like to know how to reference a control that is located on a nested
subform. Here’s my report layout. The Main Report contains Sub1 report. Sub1
report contains Sub2 report. Sub2 report contains Sub3 report. From Sub3, I
need to reference a text box on Sub2.
Here’s my first try at it…
Reports!Main!Sub1!Sub2!Text1
 
M

Marshall Barton

James said:
I would like to know how to reference a control that is located on a nested
subform. Here’s my report layout. The Main Report contains Sub1 report. Sub1
report contains Sub2 report. Sub2 report contains Sub3 report. From Sub3, I
need to reference a text box on Sub2.
Here’s my first try at it…
Reports!Main!Sub1!Sub2!Text1


From sub3 to sub2, you can use:
Parent!Text1

Or using your long way around:
Reports!Main!Sub1.Report!Sub2.Report!Text1
 
G

Guest

Thank you. I have another related question and I'm not sure if I should start
a new thread. I'll try this one first. I'm using the Long Way Around and it
works some of the time. Here's what happens. Either the report runs fine
when sub3 returns a smaller set of records, or Access freezes when sub3
returns a larger set. The larger set only contains 98 records but it’s enough
to freeze Access. Any ideas? Bottom line: the report runs fine when sub3
contains a small amount of records ( 1- 20) but Access will freeze when
trying to return 98 records.
 
M

Marshall Barton

I would look for a different cause. In my experience, the
number of records has never been an issue at any level of
subreport.

Do you have any code that might have a problem when a
special circumstance occurs? I'm not even sure what I mean
by that, just something like KeepTogether that doesn't fit
on a page? or cancelling a section when some other condition
is met??
 
G

Guest

No Code on any of the reports. In fact, I set the 'Has Module" to No on all
of them. I set the "Keep Together" to No on all the reports, sections etc...
Here's what's happening: I've altered the number of records returned by Sub3
to 47. This is a full page. The entire report (with sub1, sub2, and sub3)
runs fine. If I add one record, which would cause sub3 to go to an
additional page, Access locks and I have to End the Process. I've re-tested
this again and agian with 47 and 48 records. 47 always runs fine and 48
locks Access. Is there anything else I can try?

Marshall Barton said:
I would look for a different cause. In my experience, the
number of records has never been an issue at any level of
subreport.

Do you have any code that might have a problem when a
special circumstance occurs? I'm not even sure what I mean
by that, just something like KeepTogether that doesn't fit
on a page? or cancelling a section when some other condition
is met??
--
Marsh
MVP [MS Access]


Thank you. I have another related question and I'm not sure if I should start
a new thread. I'll try this one first. I'm using the Long Way Around and it
works some of the time. Here's what happens. Either the report runs fine
when sub3 returns a smaller set of records, or Access freezes when sub3
returns a larger set. The larger set only contains 98 records but it’s enough
to freeze Access. Any ideas? Bottom line: the report runs fine when sub3
contains a small amount of records ( 1- 20) but Access will freeze when
trying to return 98 records.
 
M

Marshall Barton

Man, that is weird. I've never even heard of such a thing,
much less experienced it.

No idea what might be causing it, beyond the usual
unexplained behavior cop out of blaming it on corrruption,
probably(?) in the data. Try Deleting the offending record.

I guess it won't hurt, beyond the time expended, to take a
look at http://www.granite.ab.ca/access/corruptmdbs.htm
 
G

Guest

Marshal, thanks for your help. I think I solved it.... Subreport 3 was in
the detail section of subreport2. I created a group footer in subreport2 and
moved subreport3 into it. Bada boom, bada bing... It now works every time,
regardless of the number of records returned in subreport3. It only took two
full work days to get it right... but it was worth it to me. Thanks again.

Marshall Barton said:
Man, that is weird. I've never even heard of such a thing,
much less experienced it.

No idea what might be causing it, beyond the usual
unexplained behavior cop out of blaming it on corrruption,
probably(?) in the data. Try Deleting the offending record.

I guess it won't hurt, beyond the time expended, to take a
look at http://www.granite.ab.ca/access/corruptmdbs.htm
--
Marsh
MVP [MS Access]

No Code on any of the reports. In fact, I set the 'Has Module" to No on all
of them. I set the "Keep Together" to No on all the reports, sections etc...
Here's what's happening: I've altered the number of records returned by Sub3
to 47. This is a full page. The entire report (with sub1, sub2, and sub3)
runs fine. If I add one record, which would cause sub3 to go to an
additional page, Access locks and I have to End the Process. I've re-tested
this again and agian with 47 and 48 records. 47 always runs fine and 48
locks Access. Is there anything else I can try?
 
M

Marshall Barton

That's still strange.

I'm glad that you got it sorted out, but other than the
subreport being repeated in every detail and the whole
report taking so long to process that it could appear to
have stopped, it should still have worked, even with many
more that 48 records.

Chalk it up to "one of those things"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top