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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to show "Continued" on certain pages 2

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
This following dilemma will be a doozy for the hardcore programmers...

I am making a Wire Table database (for running cables and organizing the wires within). Some cables have 50+ conductors inside, all of which are documented.

When i print the report, there is a header section, and the wires are listed in the continuous section. When the continuous section is too long for one page, it goes to another (the new page still contains the same header information).

How can I note that it has gone to a second page, and populate a textbox with that info? (runtime only, not stored in a table)

Like so...

Cable number reads:
R-ER 49

Page 1 of a multi page cable should read:
R-ER 49 (contd. SH 1 of 3)

Page 2 needs to read:
R-ER 49 (contd. SH 2 of 3)

You get the idea.

So I need something to count the records, then realize that only X number of records fit per page, then calculate how many pages are needed, and fill an unbound textbox. Simple!

I warned it was only for hardcore.

Thanks. Sean.
 
1. Create your Continued label on the detail line of the report.
you want it to print on every line a record shows.
now we just have to make it only show on the last record of the page
2. make the label invisable
3. make a globel variable in the report code
4. on the Open event create a function that
a. calculates the number of records able to fit on a page
numrec = (11 - topmargin - bottum margin - page/group/report headers - page/group/report footers) / detail line hieght

5. in the Onpage event reset global varable
6. in the OnDetail event
a. add 1 to gloable variable
b. if global variable = calculation in 4a then make label visable else make label invisable


this will assume that each page is formated identically if that are not you will have to calculate the equation in 4a on each page. this could get very tricky. this I don't know how to do.



Brought to you By Nedaineum
|
|
The port to Geektron
 
Access allows a quick and easy way of counting the number of pages on a report. You can place this code in the control source of a text box that is in either the "Page Header" or "Page Footer"


= [cableNumber] & " (contd. SH " & [Page] & " of " & [Pages] & ")"


Where [cableNumber] is the name of the field that holds which cable number this report is for

You could also so something like this so that it will only put "contd." if there is moe than one page


= iif( [Pages] > 1, [cableNumber] & " (contd. SH " & [Page] & " of " & [Pages] & ")", [cableNumber])


This will print only the cable number if there is only one page, and will print the cable number along with the page number and so forth if there is more than one page.

I hope this helps!

Tom
 
Those are both great suggestions, but each has one possible dilemma.

Nedaineum,

The cable number field is in the page header, not in the detail section.

Tom,

The report will generate ALL cables in the package, not just one. So there could be 3, or there could be 100 cables in there. Each needs to calculate that continued.

But perhaps it would be easier to make one report per cable (same report but it jsut reopens a bunch of times)?

Thanks. Sean.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top