Subreport problems

S

Sandy H

Hi
I have a report that has two subforms on it. The report works fine without
the subreports in it but as soon as I add the subreports and link the
correct child master fields, the report stops working. As soon as you try
to open the report, it seems to freeze (display at bottom left says,
'formatting page'). I have tried recreating the subreports but the same
thing happens. I am using Access 2003 but the problem also happens with
Access 2000. Any ideas.

Sandy
 
V

Van T. Dinh

Do you have code in any of the Events of the Report and SubReports?

You need to watch out for these as some Event codes are executed multiple
times when Access processes the Report.
 
S

Sandy H

The only code I have is docmd.maximise and three lines of code in the NoData
Event. This code is only in the main report. There is none at all in the
sub reports. The sub reports work fine by themselves and so does the main
report.

Sandy
 
V

Van T. Dinh

Do you mean you have the DoCmd.Maximize in one of the Report Events?

If that the case, try it out and run it AFTER your OpenReport statement.
Also try setting the CanShrink and CanGrow Property of the SubReports to
False and see whether a cause can be identified.

Iam not sure what the cause in your case. In my case, I have just overcome
a similar problem but I have very complex code in the Report_Open Event and
Detail_Format Event (re-positioning / hiding about 50 Controls including 12
SubReports depending on the data). The Detail_Format Event occurs twice even
though I have only one "row" in the Report's RecordSource. Hence, my code
got executed and a number of Controls got moved to the wrong place. When
this happens, it is likely that Retreat Event occurs and the Detail_Format
Event code gets called again and the execution runs into an infinte loop!
 
S

Sandy H

Thanks for the advice. I worked out this morning that the report works fine
when I change the CanGrow property to No but this is a nuisance as this
subform will often have nothing but can have up to 10 rows of data. Any
thoughts on a way around using this property.

Thanks
Sandy
 
V

Van T. Dinh

Does the problem occur on both Preview and Print or only on Print?

I have seen cases where the Preview is fine but Print goes into an infinte
loop ("Formatting ... Page Breaks" in the Status Bar). I am sure that there
are slight differences in how Access processes Preview and Print of a
Report.
 
S

Sandy H

Unfortunately the problem happens in both preview and print and the only way
to prevent seems to be
to change the CanGrow to no.
 
V

Van T. Dinh

Have you been updating your OS / Access installation and applying all the
Service Releases / Patches available for your OS / Office / Access?

If you have, I am not sure this will solve your problem but try the
following:

1. Set the CanGrow Property of the SubReportCONTROL back to Yes / True.

2. In the Design View of the Report being used as SubReport (more
technically accurate, being used as the SourceObject of the
SubReportControl), check each section (Report Header/Footer , Page
Header/Footer, Group Header/Footer and the Detail Section) and do the
following:

* Set the CanGrow / CanShrink of each section to No / False.
* Set the KeepTogether, ForceNewPage, NewRowOrCol Property of each Section
to No / False.
* If you don't use a Section, set its Visible to No / False, even when the
height has been set to zero.
 

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