Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Limit the no. of pages a report should print on

Status
Not open for further replies.

tar28un

Technical User
Nov 29, 2005
58
0
0
GB
Hi there,

I am creating a report which is grouped on some provider no. and based on these provider no. its picks up the details of pupils who are attending that provider,s nursery. Now for each provider the no. of pupils who are attending the nursery is different. Some has got 15 but other could have 25. I know the maximum no. of pupils they can have. what I want to do is setup something that will tell the report that the total no. of pages for each provider should not exceed say 5 or 6 and if suppose that the total no of kids are less than what could come on those 5 pages then instead of start printing other provider's information, it should print blank coloumns in the spare space so that when we send out these pages to provider they can add information about any new pupils they enrolled. Means for every different provider I want to give 5 or 6 pages and then after 5 or 6 pages the other provider info should start. I want my info like this also because, I am printing my report back to back and if suppose the data finishes in three pages i.e one full page back to back and other half only on one side then it starts printing the other provider details on the remaining side of the other page which I dont want as I wnat to send these pages to those providers.

Is this is possible, if so how
 
tar28un
There are two issues here.

To have each provider start on a new page, do these things...
1. Set Sorting and Grouping to the Provider field. (I assume you are already doing this, but I include it just to cover all the bases)
2. In Design view, double click on the wide gray bar that indicates the Detail section. Set Force New Page to "after section."

As for how to make sure that each provider's page starts on an odd numbered page, that takes a little more work, and involves putting code, I think, on the Format event for the Detail section. I'll play around with that and post back.

Tom
 
Many thanks for the help

I would be very grateful for the code
 
tar28un
While I'm sure that what you want to do can be done, I haven't quite got it. And, unfortunately, I am going to be tied up for the next several hours.

What I did, so far, was this:
1. Put a text box in the Group Header. The control source for that text box would be = Page
2. Then in the Format event for that Group Header I put the following code...
Code:
Dim intTemp As Integer
intTemp = Me.NameOfTextBox
If intTemp Mod 2 = 0 Then
Me.Section(acDetail).ForceNewPage = 2
End If

But that only takes you part way. The difficulty is that whenever the Mod operator = 0 a new page is forced, irrespective of the Group, so you could have blank pages within the Provider group, and that isn't what you want.

You will have to put an additional text box that resets the page text box to 1 whenever a new group occurs, and then twiddle with the Mod operator to make it come out so that a new page is forced at the proper time.

Or maybe there's another way entirely. As I say, that's as far as I got.

Good luck with your project.

Tom
 
Many thanks Tom,

I will give it a try and see what comes out.

Regards

Sarika
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top