Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Help With Report Footer Total? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have a report that prints a dollar amount from an unbound text box

    There is code in the report that determines the amount to be printed then moves the amount to unbound text control named TownPortion.

    The amount prints correctly, however I

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need Help With Report Footer Total? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You cannot calculate the Sum, Average, Max etc. of a control in a report. Since you calculate the value for TownPortion in code, you must also keep a running total in code, and use this to set the value of TotalTownPortion.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need Help With Report Footer Total? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I added the following and now my running total is doubled

    Do I have things in the right place?, do I need to use the If FormatCount = 1 Then ?

    Thanks, John

    <pre>Private mcurTotalTownPortion As Currency

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    mcurTotalTownPortion = mcurTotalTownPortion + Me.TownPortion
    End Sub

    Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
    TotalTownPortion = mcurTotalTownPortion
    End Sub
    </pre>


  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need Help With Report Footer Total? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Yes, it might be that your detail section is formatted more than once, so I would try

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If FormatCount = 1 Then
    mcurTotalTownPortion = mcurTotalTownPortion + Me.TownPortion
    End If
    End Sub

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need Help With Report Footer Total? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Hans

    The above didn

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need Help With Report Footer Total? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    No. If possible, post a stripped down copy.

  7. #7
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Need Help With Report Footer Total? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Hans

    I moved my running sum from

    <pre>Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    mcurTotalTownPortion = mcurTotalTownPortion + Me.TownPortion
    mcurTotalOtherDisburses = mcurTotalOtherDisburses + Me.OtherDisburses
    End Sub
    </pre>


    To

    <pre>Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    mcurTotalTownPortion = mcurTotalTownPortion + Me.TownPortion
    mcurTotalOtherDisburses = mcurTotalOtherDisburses + Me.OtherDisburses
    End Sub
    </pre>


    and totals are correct now.

    Thanks, John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •