Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / December 2005

Tip: Looking for answers? Try searching our database.

Subreport problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sandy H - 06 Dec 2005 00:56 GMT
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
Van T. Dinh - 06 Dec 2005 10:53 GMT
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.

Signature

HTH
Van T. Dinh
MVP (Access)

> Hi
> I have a report that has two subforms on it.  The report works fine
[quoted text clipped - 6 lines]
>
> Sandy
Sandy H - 06 Dec 2005 11:05 GMT
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

> Do you have code in any of the Events of the Report and SubReports?
>
[quoted text clipped - 11 lines]
>>
>> Sandy
Van T. Dinh - 06 Dec 2005 13:52 GMT
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!

Signature

HTH
Van T. Dinh
MVP (Access)

> 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
Sandy H - 06 Dec 2005 21:02 GMT
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

> Do you mean you have the DoCmd.Maximize in one of the Report Events?
>
[quoted text clipped - 18 lines]
>>
>> Sandy
Van T. Dinh - 07 Dec 2005 14:15 GMT
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.

Signature

HTH
Van T. Dinh
MVP (Access)

> 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
[quoted text clipped - 3 lines]
> Thanks
> Sandy
Sandy H - 09 Dec 2005 00:49 GMT
Unfortunately the problem happens in both preview and print and the only way
to prevent seems to be
to change the CanGrow to no.

> Does the problem occur on both Preview and Print or only on Print?
>
[quoted text clipped - 10 lines]
>> Thanks
>> Sandy
Van T. Dinh - 09 Dec 2005 12:51 GMT
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.

Signature

HTH
Van T. Dinh
MVP (Access)

> Unfortunately the problem happens in both preview and print and the only
> way to prevent seems to be
> to change the CanGrow to no.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.