View Full Version : Total per page


Proditech Orion
05-09-2007, 10:14 AM
Hello Grand community,
I have a problem, I seek your advice
I would like to know how can I calculate totals per page.


Ex: I have some items that span across 10 pages, but I would like to be able to show in the paper I printed to my client, the total per page corresponding to the itens showed on that page.

Any help you can give me, would be greatly appreciated
Thx in advance
MN

mnsmwk91
05-09-2007, 01:27 PM
Place a text box in the page footer and call it txtPagesum
In the print event of the Page header write the following:

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)

txtPageSum = 0
End Sub

In the print event of the Detail section type the following:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

If PrintCount = 1 Then
txtPageSum = txtPageSum + EMP_Slry
End If
End Sub

where EMP_Slry is the name of ur textbox that holds the prices or whatever u want to sum...then fire and u'll get it

Proditech Orion
05-09-2007, 02:24 PM
I am... astonished with the beauty and simplicity of your approach. I am still smiling. I thank you

I dare to ask part 2/2 of my question.

Now that I can see the total for each of my pages, I would like to have that same total on the top of the next page. Transporting that total to the top of the page would be a blast. Can that be possible?

AGAIN... many thx in advance.