A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Previous pages running total on the next page header



 
 
Thread Tools Display Modes
  #1  
Old March 31st, 2010, 03:22 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Previous pages running total on the next page header

Is there a reason why you don't use a running sum on a text box?
--
Duane Hookom
Microsoft Access MVP


"Access infant" wrote:

Hi,
I want to display the previous pages total on the page header of the next
page. for this i used the following code.
Dim bfTotal As Long ' bf stands for Brought forward

Private Sub ReportHeader0_Format(Cancel As Integer, FormatCount As Integer)
bfTotal = 0
End sub

Private Sub PageHeader0_Format(Cancel As Integer, FormatCount As Integer)
me.txtbfTotal = me.txtbfTotal + bfTotal
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
bfTotal = bfTotal + me.pay
End sub

But it is not working!!!. Can any one tell me how to do this and where i am
going wrong in the code.
Thanks in advance

--
from
chanakya
Baruva

  #2  
Old April 5th, 2010, 04:15 AM posted to microsoft.public.access.reports
Access infant
external usenet poster
 
Posts: 14
Default Previous pages running total on the next page header


The problem is it is showing the Brought forward column on the first page
also. could you tell how to work this around.
I don't understand why you used the expression:
Control Source: =[txtRunSum]-[NumField]

when i calculate it using print and format events, it is giving double sum.
So, can the same logic be used in calculating page totals? if so, could you
tell how?
--
from
chanakya
Baruva



  #3  
Old April 6th, 2010, 05:29 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Previous pages running total on the next page header

So, your only issue with this solution is it displays on the first page? If
this is the case, hide the control on the first page.

--
Duane Hookom
MS Access MVP


"Access infant" wrote in message
...

The problem is it is showing the Brought forward column on the first page
also. could you tell how to work this around.
I don't understand why you used the expression:
Control Source: =[txtRunSum]-[NumField]

when i calculate it using print and format events, it is giving double
sum.
So, can the same logic be used in calculating page totals? if so, could
you
tell how?
--
from
chanakya
Baruva



  #4  
Old April 6th, 2010, 02:50 PM posted to microsoft.public.access.reports
Access infant
external usenet poster
 
Posts: 14
Default Previous pages running total on the next page header

Thank you very much.But how to hide the control only on first page? I am not
good at writing the code. Please give me the code also.

Please also clarify why you used the expression:
controlsource: = [txtRunSum]-[NumField].
I can't understand the logic behind it
  #5  
Old April 7th, 2010, 04:41 AM posted to microsoft.public.access.reports
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default Previous pages running total on the next page header

I used that expression because I tried it without the -NumField and the
value was exactly NumField too much.

To hide a control on the first page, you could try to add a [Page] page
number in the page header or footer section. Then in the code for the
section containing the text box, add code to hide the control like:
Me.TxtYourTextBox.Visible = [Page]1

--
Duane Hookom
MS Access MVP


"Access infant" wrote in message
...
Thank you very much.But how to hide the control only on first page? I am
not
good at writing the code. Please give me the code also.

Please also clarify why you used the expression:
controlsource: = [txtRunSum]-[NumField].
I can't understand the logic behind it


  #6  
Old April 7th, 2010, 01:27 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Previous pages running total on the next page header

Duane Hookom wrote:

I used that expression because I tried it without the -NumField and the
value was exactly NumField too much.

To hide a control on the first page, you could try to add a [Page] page
number in the page header or footer section. Then in the code for the
section containing the text box, add code to hide the control like:
Me.TxtYourTextBox.Visible = [Page]1



Maybe it's past your bedtime, Duane ;-)

It's Pages that needs to be used in a control expression.
Page is always available.

--
Marsh
MVP [MS Access]
  #7  
Old April 7th, 2010, 04:07 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Previous pages running total on the next page header

Marsh,
Thanks for the correction. Hate to waste a control when it isn't needed ;-)

--
Duane Hookom
Microsoft Access MVP


"Marshall Barton" wrote:

Duane Hookom wrote:

I used that expression because I tried it without the -NumField and the
value was exactly NumField too much.

To hide a control on the first page, you could try to add a [Page] page
number in the page header or footer section. Then in the code for the
section containing the text box, add code to hide the control like:
Me.TxtYourTextBox.Visible = [Page]1



Maybe it's past your bedtime, Duane ;-)

It's Pages that needs to be used in a control expression.
Page is always available.

--
Marsh
MVP [MS Access]
.

  #8  
Old April 7th, 2010, 06:13 PM posted to microsoft.public.access.reports
Access infant
external usenet poster
 
Posts: 14
Default Previous pages running total on the next page header

Mr.Marsh,
I can't follow your advice unless you elaborate.How should i write the code
if i don't want to add a control
--
from
chanakya
Baruva



  #9  
Old April 7th, 2010, 06:17 PM posted to microsoft.public.access.reports
Access infant
external usenet poster
 
Posts: 14
Default Previous pages running total on the next page header

Mr. Duane, thank you very very much. I tried what you told and I understood
why you used the expression -Numfield. Moreover, this suggestion solved the
problem of the page total also. I earlier tried to calculate it by way of
code but the total was more than doubled always when i tried to print it.
Your suggestion helped me with that problem also. Thank you once again
--
from
chanakya
Baruva


  #10  
Old April 7th, 2010, 08:39 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Previous pages running total on the next page header

Access infant wrote:

Mr.Marsh,
I can't follow your advice unless you elaborate.How should i write the code
if i don't want to add a control



I was just reminding Duane that the part about "...add a
[Page] page number in the page header or footer section" was
unnecessary.

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.