Carry the page total to another page first line

I

Irshad Alam

I have a report of few pages, my requirement is that I want a field on each
page for the page total and in the next page it should have the first line as
the last page total stating as ...carried the total till page No 1 or so on
for the next pages.

I mean if the first page total is 1245, then the second page should start
the first line of the page should be : Carried total till last page 1245,
and the below line all data. then again at the last of the page - the page
total field should have 1245 plus all the data of the page and the same so on
the next pages.

please advise me method, code or any sample available to do this.

Regards

Irshad
 
M

Marshall Barton

Irshad said:
I have a report of few pages, my requirement is that I want a field on each
page for the page total and in the next page it should have the first line as
the last page total stating as ...carried the total till page No 1 or so on
for the next pages.

I mean if the first page total is 1245, then the second page should start
the first line of the page should be : Carried total till last page 1245,
and the below line all data. then again at the last of the page - the page
total field should have 1245 plus all the data of the page and the same so on
the next pages.


Use a running sum text box (named txtRunTotal) to calculate
the running total. Then you can use code in the page footer
section's Format event to put the value in both the page
header and page footer text boxes:

Me.txtHdrTotal = Me.txtRunTotal
Me.txtFtrTotal = Me.txtRunTotal
 
I

Irshad Alam

Sir,

I followed your advise and did the following and an error produced, the
details is as below:

I added a text box in the details section - named it "txtRunTotal", control
source set it to field I wanted to total, RunningSum - selected to OverAll.
Added One textbox to pageHeader Section and Another TextBox to pagefooter
section.
Pasted the below code to pagefooter OnFormat section:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageHeaderText = txtRunTotal
Me.PageFooterText = txtRunTotal
End Sub

All the pages figures shown in the Pageheader Text and pagefooter text are
correct except the report first pageheader value and lastpage header value is
not correct, In this first and last pages it shows the grand total value.

Please check the above method and advice me how to hide the first page only
textheader (as u can understand the first page does not requires/cannot find
the last page total value and it will look bad). And how to correct the last
page header text (It should have the value of the second last page).

You advice will be very much awaited, which will help me to complete a long
pending issue.

Regards

Irshad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top