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

another page number question

Status
Not open for further replies.

ITbeast

IS-IT--Management
Jul 25, 2006
67
US
Hello,

I'm wondering if there is a way to record what page number and line number a particular record was shown on when the report was first ran.

Let me try to visually explain this:
------------------------------------------------------------
Report A Page 1
------------------------------------------------------------
Address Residents
------------------------------------------------------------
1. House 1 No Information collected
2. House 2 No Information collected
3. House 3 No Information collected
------------------------------------------------------------


Ok, so I need to record that House 1 was on line 1 and House 2 was on line 2 for whenI run another report. That report will look like this:

------------------------------------------------------------
Report B
------------------------------------------------------------
Line Page Address Residents
------------------------------------------------------------
1. 1 House 1 Jim Reynolds
1. 1 House 1 Sarah Reynolds
1. 1 House 1 Jennifer Reynolds
2. 1 House 2 Jessica Peterson
2. 1 House 2 Mike Smith
3. 1 House 3 Greg Gilbert
3. 1 House 3 Gail Gilbert

------------------------------------------------------------


I was thinking if I could store the line number in a table, then i could just pull that info back out and print it with the other information. What I'm not sure about is how would I grab that line number and store it? Right now I'm numbering the lines with a text box that starts with 1 and increments. Any suggestions are welcome!
 
You show above each record on a single line. If this is always the case, I think it would be better to set up the numbering prior to creating the report. You can test the number of lines that fit comfortably on a page and create a page number that changes at this count. You could then use this table to set groups.
 
Ok, that's not a bad idea. I didn't even think of that. Does anyone know if I'm using something like =1 for a test field then using the running sum property. Is there a way to make it start over at 1 for each new page?
 
If you follow the plan I mention, you will not need to.

However, you can build your own running sum, with an unbound textbox:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.txtCounter= Nz(Me.txtCounter, 0) + 1
End Sub

Private Sub Report_Page()
Me.txtCounter= 0
End Sub
 
You need to be quite careful with the above schemes. Reports include a number of 'properties' - some of which will dynamically change the page number even after the format event "Has Continued" / "Will Continue / OnRetreat" refer to wheather a section traversing a page boundary. These properties/events may change the page on which individual records are printed.





MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top