Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Totalling a field via a cbo (A2K)

    I have a field called cboBin on a continuous form called subFormParts.
    I have a second field on the same line called txtFP_01 whose data source is =cboBin.column(5).
    It displays the correct data with no problem.
    What I'm attempting to do is get a total of the contents of txtFP_01 in the subFormParts footer.
    I've tried:
    =Sum([txtFP_02]) which gives me an error
    and
    =cboBin.column(5) which displays the first record in the subform lines
    and
    =Sum(cboBin.column(5)) which gives me an error

    I'd appreciate any help on this from someone who may have been able to accomplish this.
    Cheers,
    Andy

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

    Re: Totalling a field via a cbo (A2K)

    As you have found, this won't work.

    One option is to add the field that you want to sum to the record source of the subform. You can then use =Sum([FieldName]) as control source for the text box in the footer.

    Another one is to use a DSum expression in the control source of the text box in the footer. You'd have to find the appropriate where-condition to use as third argument for DSum.

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Totalling a field via a cbo (A2K)

    Thanks Hans,

    back to the drawing (coding) board
    Cheers,
    Andy

  4. #4
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Totalling a field via a cbo (A2K)

    Hans,
    Back from the Drawing/Coding Board! The "add to the record source of the subform" suggestion worked very nicely,

    Thanks again,
    Cheers,
    Andy

Posting Permissions

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