Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Printing page breaks between subform records

Author  Topic 

whill96205
Starting Member

46 Posts

Posted - 2004-07-30 : 14:13:57
Here's something I can't track down...

We have an Access report for printing invoices. A subform which contains invoiced items is positioned in the Details section of the main report form so that it prints in a certain place on the hardcopy invoice. The hardcopy has space for 7 items to print; if there are more than 7, the report needs to start printing a second page.

The problem seems to be that I can't "force" a page break in the middle of printing the subform. If I set properties for the subform to No Growth, then the first 7 items print, but there is no page 2. If I set it to allow Growth, the subform prints all the way to the bottom of the page before starting page 2. If I insert a page break after the subform, the page break isn't processed until after the overgrown subform prints all the way to the bottom of the page. Setting the main report's Details section to Growth/No Growth doesn't do any better. What can I do to fix this?

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-07-30 : 15:32:26
Why are you using subforms/subreports?

You should be able to print an invoice with items by just using a standard report. Have a look at the Northwind samples to see what I mean. Subreports are handy if you're doing something complex, but from what it sounds like all you need is a standard report.
Go to Top of Page

whill96205
Starting Member

46 Posts

Posted - 2004-08-12 : 10:43:52
I'm back!

The report was designed with the sub-report, probably because the data in the sub-report is not being pulled from the results of the query which is the data source for the main report.

Hmmm... I see that Northwind also uses a query as the Data Source for its Invoice report, but it's itemized list is comprised of data that actually is included in that query. Looking at it in Design View, however, the Details section seems to only include the usual product related fields (name, quantity, price, etc.) -- what makes the report REPEAT that data when there is more than one product to be listed? Does that just happen automatically if there is more than one row in the query that is related to that order?
Go to Top of Page

whill96205
Starting Member

46 Posts

Posted - 2004-08-12 : 10:57:24
Also...

I imagine that the report designer used the sub-report approach to reduce the "size" of the query results. The main report's data source is a query based on order information, and the sub-report is based on order details. There are tens of thousands of orders, and some of them have quite a few records in the order details table. To combine them together into one query for the invoice report would result in a massive amount of query results (# of orders x # of order-details), and it would contain lots of repetitive information, wouldn't it?
Go to Top of Page

whill96205
Starting Member

46 Posts

Posted - 2004-08-12 : 12:19:47
Basing my new main report on the "standard" approach, I now have a report form that works! I have also, subsequently answered my own questions.

Timmy, thanks for the suggestion to follow Northwind's example.

--Whill
Go to Top of Page
   

- Advertisement -