Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Running Sum (AXP)

    Hello All,
    Is there anyway to have a control on a form be a running sum of some other controls without having to write all the code to do so? I have a form with 10 rows. One of the columns has a price column. At the bottom of the form, I want another control that displays the total. I know I can do it with code but I think that there may be an easier method.

    Thanks,
    Mark

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

    Re: Running Sum (AXP)

    <P ID="edit" class=small>(Edited by HansV on 04-Apr-03 22:08. Replaced semicolons in expression by commas (localization problem))</P>If you have a field with unique values by which the form is ordered, you can use this in a DSum expression.

    Say your form MyForm is ordered by the ID field from MyTable; you want a running sum for Price. The Control Source for the running sum could look like this:<pre>=DSum("[Price]","[MyTable","[ID] <= Forms![MyForm]![ID]")</pre>

    If you don't have such a field, I don't know how to compute a running sum without code.

  3. #3
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Running Sum (AXP)

    Thanks Hans,
    That appears to work well.

    Mark

Posting Permissions

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