Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85

    Unhappy Unanswered: Simple calculation in report footer

    Dear All

    I am trying this simple calculation for last 2 hours but still not successful.

    A group footer in a report has a text box Text100 with control source e.g

    =[Text50]+[Text23]+[Text69]

    Now on the same Report footer I want to calculate the sum of all the values for all groups

    I used a text box with control source

    =Sum([Text100])

    But it does not recognize Text100

    Can somebody please let me know how to calculate overall sum in report footer?

    thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    try
    sum([Text50]+[Text23]+[Text69])
    failing that.....
    sum([Text50])+sum([Text23])+sum([Text69])
    better yet sum ([columnname])......

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi dbase

    For your Report, did you sum the items across and get the calculated total in the Text100 TextBox? Something like this all in the DetailSection:

    Text100: =[Text50]+[Text23]+[Text69] This would be placed in the Text100 TextBox.

    Then, in your GroupFooter place a TextBox and put this in it:

    =Sum([Text50]+[Text23]+[Text69])

    Place the same thing you have in the GroupFooter in the ReportFooter to get the GrandTotal for all.

    One tip: to make it easy for someone else to figure out your database, it helps to Name your objects. Things like Text50 makes a person have to really look around and figure out just what it is or does. In my database I have mine named like txtSubTotal, txtGrandTotal, etc. Just a tip.
    Anyway, try out what I have above and it should get you the results you need. It came right out of my database report.

    have a nice one,
    BUD

  4. #4
    Join Date
    Mar 2003
    Location
    UK
    Posts
    85

    Smile

    Thank you very much for your replies.

    Basically I have tried all option but I think the only way it would work is to use following in report footer

    sum([Text50])+sum([Text23])+sum([Text69]) as suggested by healdem

    and not just that because in my repot Text50, Text23 and Text69 are again based on calculated text boxes.

    The only way to do it is to put all the calculation for each text box in it in report footer because for some reason report footer does not allow a referenct to a calculated text box.

    Lastes is that I have finally managed to do it by using the above method

    thank you for replies

  5. #5
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    Quote Originally Posted by dbase
    Thank you very much for your replies.

    Basically I have tried all option but I think the only way it would work is to use following in report footer

    sum([Text50])+sum([Text23])+sum([Text69]) as suggested by healdem

    and not just that because in my repot Text50, Text23 and Text69 are again based on calculated text boxes.

    The only way to do it is to put all the calculation for each text box in it in report footer because for some reason report footer does not allow a referenct to a calculated text box.

    Lastes is that I have finally managed to do it by using the above method

    thank you for replies
    You can't sum a calculated control, so you can either use your method or you can try another approach. When faced with summing on a report, I tend to perform my calculation in one control - like [txtCalctotal] = [txtPrice]*[txtQuantity] - and then use the calculated box as the control source for a second box. [txtSubtotal] = [txtCalctotal] I then sum this box in the report footer, rather than the calculated box.

    = SUM([txtSubtotal])

Posting Permissions

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