Prev: Zero Suppress
Next: Sum ignoring hidden duplicates
From: Duane Hookom on 31 Mar 2010 10:22 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
From: Access infant on 4 Apr 2010 23:15 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
From: Duane Hookom on 6 Apr 2010 00:29 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" <Accessinfant(a)discussions.microsoft.com> wrote in message news:B7A1E41F-D76F-49CA-B211-D0D014AE609C(a)microsoft.com... > > 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 > > >
From: Access infant on 6 Apr 2010 09:50 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
From: Duane Hookom on 6 Apr 2010 23:41
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" <Accessinfant(a)discussions.microsoft.com> wrote in message news:E1CF20A9-A0D3-4960-A447-D1FBB162F123(a)microsoft.com... > 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 |