Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    Posts
    2

    Question Unanswered: calculated field based on a subform field

    I am trying to sum a repeating field from a subform on my main form. I have a field on the subform called PartCharge. I need a field on my main form that totals all the PartCharges entered for that record. I have tried to sum the field in the subform and then reflect that field on my main form. I have also tried to sum the fields directly from the main form. I am having no success. Please help...

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    the best i can think of is a sub form that has

    SELECT Sum(<fieldName>) AS field FROM <Table Name>; as it's data source, you could even inclued this as the main forms data source as long as it doesn't need another data source
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Jan 2003
    Posts
    46
    Kristinac,

    Make sure that you have a textbox in the subform's FORM FOOTER (not the page footer or detail section). Set its name to txtPartChargesSum and control source to:

    =Sum([PartCharges])

    Then you can reference it in the main form by setting the control source of a text box to:

    =[YourSubFormName].Form![txtPartChargesSum]


    Cheers
    zambezibill

  4. #4
    Join Date
    Mar 2003
    Posts
    2
    Thank you for the replies. I finally got it to work. I summed the field on the footer of the subform, then called that field on the main form. It seems to be working...Thanks again.

Posting Permissions

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