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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|