Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9

    Creating a Text Box to Display a Running Total

    Hi all,

    I'm new here, the (nick)name's Art_Of_War. Glad to be here, it seems like a good place to post Access-related questions and get a specific answer that solves the problem.

    I've been designing a database for a client who wants his Accounts form to display a running total; that is, a text box which displays the sum of previous "Balance" entries plus the current entry but no more than that. What I've got so far is a field that sums my Credit and Debit fields for the whole form, but this is not much good to us because it displays the same value in every Running Total field.

    Is there a way to create a proper, functional Running Total using the Expression Builder, or should I start playing around with VBA arrays etc.?

    My client says it's standard accounting practice to have such a field in there (although it's not actually on his Accounts slips).


    See pictures for more info, I hope I've explained everything so that it makes sense.



    Click image for larger version. 

Name:	WakesAccountsSnip.PNG 
Views:	50 
Size:	23.0 KB 
ID:	31859
    Figure 1: Accounts form

    Click image for larger version. 

Name:	WakesAccountSlip.jpeg 
Views:	48 
Size:	63.7 KB 
ID:	31860
    Figure 2: Accounts slip

    Hope you guys can help me work this one out, it's one of the few final touches I need to add to the DB before he starts using it (and pays me for it).

    Regards,
    - Art_Of_War.


    P.S. This thread might belong in a different section, I can't seem to move it after having posted it.
    Last edited by Art_Of_War; 01-01-2018 at 06:41 AM. Reason: FYI

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    On a report you can use the running sum property of a textbox. You can also do it in a query:

    https://support.microsoft.com/en-us/...crosoft-access
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9
    Thanks a lot for your response!

    To follow up with another question, HOW would I implement this in the context of a report? I.e. what syntax would I use for the code/expression behind the Running Total text box?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Did you look at the property? No code or expression, just set the property appropriately. Perhaps you can post a sample db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9

  6. #6
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9
    You're a moderator, @pbaldy--would you mind moving this thread into the "Access" forum? Thanks

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is this what you're after?
    Attached Thumbnails Attached Thumbnails 2018-01-02_9-39-43.jpg  
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9
    Yes! Exactly that! You're a legend, mate... how did you get that result? (And how much do I have to pay you to disclose the secret? )

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I did exactly what I suggested; bind the textbox to the balance field and set the running sum property.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    This appears to be a very similar question to this one https://www.access-programmers.co.uk...d.php?t=297161
    Cross-posted methinks ?

  11. #11
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9
    And the code for the running sum is...?

  12. #12
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    There isn't any.
    As Paul's explained, it's a property setting in the reports control.

  13. #13
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9
    OH Snap, there it is! Should I do it "Over Group" or "Over All"?

  14. #14
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    That depends on if you have grouped the reporting by any field. For instance if your report grouped by customer then you would want it "over group"
    If not "Over All" should do it, but run some sanity checks on the data to make sure it's correctly doing what you want it to.

  15. #15
    Art_Of_War's Avatar
    Art_Of_War is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jan 2018
    Location
    Australia
    Posts
    9
    Ok thanks, I'm marking this thread as "Solved."

    And may the cretins at access-programmers.co.uk rot in hell! :P

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help with running total
    By sconnors in forum Database Design
    Replies: 17
    Last Post: 07-18-2017, 10:26 AM
  2. Replies: 6
    Last Post: 09-14-2015, 06:05 PM
  3. Running total
    By lololthis in forum Queries
    Replies: 5
    Last Post: 06-21-2011, 04:14 PM
  4. Replies: 3
    Last Post: 10-23-2009, 05:03 PM
  5. Creating a Daily Running Total Query
    By seraph in forum Queries
    Replies: 0
    Last Post: 08-15-2009, 12:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums