>-----Original Message-----
>
>>-----Original Message-----
>>> I've tried that. I get an error pertaining to the
>bottom
>>> section: Error number 2100: The control or subform
>control
>>> is too large for this location.
>>>
>>> Somehow, I need to get this subreport to continue
onto
>the
>>> next page, if it hits the bottom.
>>>
>>> Since the number of records in the detail sections can
>>> vary, the size of the subreport grows or shrinks with
>it.
>>
>>Have you set all the Subreport Controls' CanGrow and
>CanShrink property to
>>Yes? Have you set the main Report's Detail Section's
>CanGrow and CanShrink
>>property to Yes? Have you then squeezed the Subreport
>Controls in Design
>>View so they all fit on the Page?
>>
>>When is it that you are getting Error 2100? In Design
>View or at Runtime?
>>
>> Larry Linson
>> Microsoft Access MVP
>>
>Larry,
>It happens at run-time. In my initial attempt using
>subreports, I would align the sections like:
>
> With Me
> !sr_MRRDisposition.Top = !sr_MRRDefects.Top + !
>sr_MRRDefects.Height
> !sr_MRRCA.Top = !sr_MRRDisposition.Top +
>sr_MRRDisposition.Height
> End With
>
>The forms need to align with sr_MRRDefects on the top,
>sr_MRRDispositions in the middle and sr_MRRCA on the
>bottom. This code works fine for aligning the
>sr_MRRDisposition subreport, but gives an Error 2100 run-
>time error for the sr_MRRCA report. I found this out for
>two reasons:
>
>- The second section aligns properly, but the third
>doesn't.
>- The run-time error does not occur if I leave the first
>statement in, and 'remark out' the second.
>
>I checked all the CanGrow & CanShrink propreties.
They're
>okay.
>
>The only other contributing factor is that under this
>scenario, the bottom section also runs into the bottom
of
>the page. I need it to continue on to the next sheet in
>this case. I don't know if that has to do with it or not.
>
>The ponderous thing is that it draws the last subreport
>control okay, with no errors, if I remark out the second
>statement. It's not until I try to change the Top
>property that it gives an error.
>
>Thanks for your help,
>Joel Wiseheart
>
Okay, I found the answer to my problem, if anyone else is
watching this thread. From the VB help:
"When you open a form based on an underlying query,
Microsoft Access runs the underlying query for the form
before it runs the Open macro or event procedure.
However, when you open a report based on an underlying
query, Microsoft Access runs the Open macro or event
procedure before it runs the underlying query for the
report."
....and...
"When you first open a form, the following events occur
in this order:
Open Þ Load Þ Resize Þ Activate Þ Current"
The problem was that I was trying to relocate the form
sections during the Open event, at which point the
underlying query had not run yet. By moving the code to
the Activate event, it now works as expected.
Whew! 3 days before my deadline...glad I figured that one
out!
|