Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2003
    Posts
    42

    Question Unanswered: Problem getting Subform Sum Data to Mainform

    I am trying to figure out how to get the sum of numbers in a subform back on to the main form so I can use expressions on the form to show the final numbers.

    Example:

    Form A MainForm/Table1
    Fields: StdCost, ProposedStdCost

    The following expressions are on the form-

    NoBoughtPerYr: StdCost-Usage =Sum([TA_CR00 - Cost Reduction Main Table]![12 Mo Annual Usage]/[TA_CR00 - Cost Reduction Main Table]![Current STD Cost])

    NoBoughtPerMo: =Sum([TA_CR00 - Cost Reduction Main Table]![Avg Mo Annual Usage]/[TA_CR00 - Cost Reduction Main Table]![Current STD Cost])

    Est. Mo. Cost (before charges): =Sum([TA_CR00 - Cost Reduction Main Table]![Avg Mo Annual Usage]/[TA_CR00 - Cost Reduction Main Table]![Current STD Cost]*[Proposed STD Cost])

    Est Annual Cost (before charges): =Sum([TA_CR00 - Cost Reduction Main Table]![12 Mo Annual Usage]/[TA_CR00 - Cost Reduction Main Table]![Current STD Cost]*[Proposed STD Cost])

    Est Mo Savings: =Sum([Avg Mo Annual Usage]-[TA_CR00 - Cost Reduction Main Table]![Avg Mo Annual Usage]/[TA_CR00 - Cost Reduction Main Table]![Current STD Cost]*[Proposed STD Cost])

    Est Annual Savings: =Sum([12 Mo Annual Usage]-[TA_CR00 - Cost Reduction Main Table]![12 Mo Annual Usage]/[TA_CR00 - Cost Reduction Main Table]![Current STD Cost]*[Proposed STD Cost])

    Now on the subform I have a running charges list which I was able to sum in a query, but I cant figure out a way to get an expression to get the sum of those items in the subform onto the main form so I can complete the Final Savings expressions forYR and Mo.

  2. #2
    Join Date
    Jul 2003
    Posts
    42

    forgot to mention filtered by Record No

    The subform is linked by the Record No, so I need the sum of the charge amounts for all related to the record no. Thats what I need to generate an expression for. I tried taking it from the query but them all the other expressions on the main form get the ?Name error. The only other possibility I can think of is to put all the expressions on a second subform based on a sumquery where it wont cause a conflict and prevent data entry in the main form.

Posting Permissions

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