Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Totaling a sub-form (Access 2000)

    I have a subform embedded in another form. The subform lists one or more records. One of the subform fields contains numeric values, and I need to create a total of these fields on the main form. Any recommendations as to the best way to accomplish this?

    Also, I notice that the subform lists the pertinent records, but I cannot add records to the subform. I have the Add Records property set to Yes, but to no avail.

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

    Re: Totaling a sub-form (Access 2000)

    Say that your number field is named MyField.
    In the form footer section of the subform, create a text box named txtSum. Set its Control Source to =Sum([MyField]).
    You can hide this text box if you like (set its Visible property to No).
    Create a text box on the main form with Control Source =[SubFormName]![txtSum], where SubFormName is the name of the subform as a control on the main form. This is not necessarily the same as the name of the subform in the database window.

    If you can't add records to the subform, you probably can't add records to its Record Source either. Can you check this? If so, could you supply information about the record source?

  3. #3
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Totaling a sub-form (Access 2000)

    That works! Thanks

Posting Permissions

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