Page Totals in Report

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

I need to make a page total for each page in a report I
thought I was supposed to create a page footer then make a
text box with an expression something on the following
vein:

=Sum(Round(([Reg $]+[Bnft $]+[Adjust $]),2))

The result I get is #Error. I am able to get a report
total to work in the report footer using the following
expression:

=Sum(Round(([Employees]![Reg Hours]+[Employees]![Bnft
Hours])*([Employees]![Rate])+([Employees]![Adjust $]),2))

I tried to use this expression in the page footer but get
the same error message. Where did I go wrong?

Thanks Dennis
 
Duane,
After I posted this message I searched the knowledge base
and did find the article you referenced. After following
the instructions, I experienced a couple problems.

1)When I tried it, it did not sum each page, it appears to
have summed the first page but displays the sum of the
first page on the last page? The Page Total lable from the
field shows on each page footer but no page sum. Again it
only shows on the last page?

2)When paging down in the print preview, after four pages,
I get an error message "Run time error 94 invalid use of
null" When I choose debug, the code highlights the line I
marked with *** to show you which line ***:

Private Sub Detail_Print(Cancel As Integer, FormatCount As
Integer)
*** PageSum = PageSum + Reports![TRUST REPORT]![Workers
Pay] ***
End Sub

I tried it using other fields that would total but with
the same result. What might I check next?

Thanks, Dennis
-----Original Message-----
You might want to check the KB Article
http://support.microsoft.com/default.aspx?scid=kb;en- us;216311&Product=acc.

--
Duane Hookom
MS Access MVP


I need to make a page total for each page in a report I
thought I was supposed to create a page footer then make a
text box with an expression something on the following
vein:

=Sum(Round(([Reg $]+[Bnft $]+[Adjust $]),2))

The result I get is #Error. I am able to get a report
total to work in the report footer using the following
expression:

=Sum(Round(([Employees]![Reg Hours]+[Employees]![Bnft
Hours])*([Employees]![Rate])+([Employees]![Adjust $]),2))

I tried to use this expression in the page footer but get
the same error message. Where did I go wrong?

Thanks Dennis


.
 
I didn't write the code and don't use it so I'm not sure why you experience
issue #1. To resolve issue #2, try

PageSum = PageSum + Nz(Reports![TRUST REPORT]![Workers Pay],0)
--
Duane Hookom
MS Access MVP


Dennis said:
Duane,
After I posted this message I searched the knowledge base
and did find the article you referenced. After following
the instructions, I experienced a couple problems.

1)When I tried it, it did not sum each page, it appears to
have summed the first page but displays the sum of the
first page on the last page? The Page Total lable from the
field shows on each page footer but no page sum. Again it
only shows on the last page?

2)When paging down in the print preview, after four pages,
I get an error message "Run time error 94 invalid use of
null" When I choose debug, the code highlights the line I
marked with *** to show you which line ***:

Private Sub Detail_Print(Cancel As Integer, FormatCount As
Integer)
*** PageSum = PageSum + Reports![TRUST REPORT]![Workers
Pay] ***
End Sub

I tried it using other fields that would total but with
the same result. What might I check next?

Thanks, Dennis
-----Original Message-----
You might want to check the KB Article
http://support.microsoft.com/default.aspx?scid=kb;en- us;216311&Product=acc.

--
Duane Hookom
MS Access MVP


I need to make a page total for each page in a report I
thought I was supposed to create a page footer then make a
text box with an expression something on the following
vein:

=Sum(Round(([Reg $]+[Bnft $]+[Adjust $]),2))

The result I get is #Error. I am able to get a report
total to work in the report footer using the following
expression:

=Sum(Round(([Employees]![Reg Hours]+[Employees]![Bnft
Hours])*([Employees]![Rate])+([Employees]![Adjust $]),2))

I tried to use this expression in the page footer but get
the same error message. Where did I go wrong?

Thanks Dennis


.
 
Hi Dennis,

Maybe the KB article uses the the same technique,
but I have successfully used Allen Browne's method

Reports: Page Totals
http://members.iinet.net.au/~allenbrowne/ser-11.html

Of course, as Duane has pointed out,
in the DetailSection's Print event you may
need to wrap the field(s) you are summing in NZ
if you expect Nulls .

"If PrintCount = 1 Then curTotal = curTotal + Me.Amount"

then might be

If PrintCount = 1 Then
curTotal = curTotal + Nz(Me.[Workers Pay],0)
End If

Please respond back if I have misunderstood.

Good luck,

Gary Walter
 
Hi Gary,

I followed Allen Browne's sample but I get an error
message that says:

"Microsoft Access cannot find the Macro "Me" The Macro
(or it's Macro group) doesn't exist, or the Macro is new
and hasn't been saved. Note that when you enter a
macrogroupname.macroname syntax in a argument, you must
specify the name of the macro's macro group it was last
saved under"

I do not have a macro in this database. Any ideas where I
should look for a solution to this problem?

Dennis
-----Original Message-----
Hi Dennis,

Maybe the KB article uses the the same technique,
but I have successfully used Allen Browne's method

Reports: Page Totals
http://members.iinet.net.au/~allenbrowne/ser-11.html

Of course, as Duane has pointed out,
in the DetailSection's Print event you may
need to wrap the field(s) you are summing in NZ
if you expect Nulls .

"If PrintCount = 1 Then curTotal = curTotal + Me.Amount"

then might be

If PrintCount = 1 Then
curTotal = curTotal + Nz(Me.[Workers Pay],0)
End If

Please respond back if I have misunderstood.

Good luck,

Gary Walter

Dennis said:
I need to make a page total for each page in a report I
thought I was supposed to create a page footer then make a
text box with an expression something on the following
vein:

=Sum(Round(([Reg $]+[Bnft $]+[Adjust $]),2))

The result I get is #Error. I am able to get a report
total to work in the report footer using the following
expression:

=Sum(Round(([Employees]![Reg Hours]+[Employees]![Bnft
Hours])*([Employees]![Rate])+([Employees]![Adjust $]),2))

I tried to use this expression in the page footer but get
the same error message. Where did I go wrong?

Thanks Dennis


.
 
Never mind Gary I got it. Allen does not give enough
detail for slow guys like me. After trying everything I
could imagine, it started to make sense. Thank You for the
tip!

Dennis
-----Original Message-----
Hi Gary,

I followed Allen Browne's sample but I get an error
message that says:

"Microsoft Access cannot find the Macro "Me" The Macro
(or it's Macro group) doesn't exist, or the Macro is new
and hasn't been saved. Note that when you enter a
macrogroupname.macroname syntax in a argument, you must
specify the name of the macro's macro group it was last
saved under"

I do not have a macro in this database. Any ideas where I
should look for a solution to this problem?

Dennis
-----Original Message-----
Hi Dennis,

Maybe the KB article uses the the same technique,
but I have successfully used Allen Browne's method

Reports: Page Totals
http://members.iinet.net.au/~allenbrowne/ser-11.html

Of course, as Duane has pointed out,
in the DetailSection's Print event you may
need to wrap the field(s) you are summing in NZ
if you expect Nulls .

"If PrintCount = 1 Then curTotal = curTotal + Me.Amount"

then might be

If PrintCount = 1 Then
curTotal = curTotal + Nz(Me.[Workers Pay],0)
End If

Please respond back if I have misunderstood.

Good luck,

Gary Walter

Dennis said:
I need to make a page total for each page in a report I
thought I was supposed to create a page footer then make a
text box with an expression something on the following
vein:

=Sum(Round(([Reg $]+[Bnft $]+[Adjust $]),2))

The result I get is #Error. I am able to get a report
total to work in the report footer using the following
expression:

=Sum(Round(([Employees]![Reg Hours]+[Employees]![Bnft
Hours])*([Employees]![Rate])+([Employees]![Adjust $]),2))

I tried to use this expression in the page footer but get
the same error message. Where did I go wrong?

Thanks Dennis


.
.
 
Back
Top