Results 1 to 5 of 5
  1. #1
    PRyan's Avatar
    PRyan is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2017
    Posts
    6

    Create a running total

    Hello there, I`m new to this forum but I`ve been using Access for quite a while now (I prefer working in 2003).

    I`ve got a task which I can`t seem to find an answer for.
    I have a list of sales orders with various items in them, some of these sales orders contain the same items.


    I`m trying to find a way that the available stock can be displayed against each sales order item but this available stock needs to be the stock left after the previous (older date) sales order item quantity has been removed.
    So it would look something like:

    Sales Order Item Qty Stock
    A1 X 10 50
    A2 Y 25 150
    A3 X 15 40
    A4 X 10 25

    I hope I`ve made myself clear, any ideas?
    Last edited by PRyan; 10-17-2017 at 10:42 AM. Reason: Make clearer

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    make a report,
    add an textbox of what you want to sum,
    set the property RUNNING SUM = TRUE
    set to sum OVER GROUP, or ALL, etc

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Unfortunately, I don't think textbox RunningSum will accommodate this requirement because the running sum needs to differentiate between Items across Orders. If the records are sorted and grouped by Item then possibly could calc a running sum by Item but you want to sort by Sales Order and list items under each.

    You also want each record to show net stock after deduction of Qty from previous record. This could be achieved by adding the current record Qty to the running sum calc. However, as pointed out, records would have to be sorted and grouped by Item.

    And then need to calculate a starting Stock value for each Item because I assume this report would be for a restricted period, not all data from beginning of records. Net Stock should be calculated from incoming and outgoing transactions (stock received and stock used). This would normally involve an aggregate query to sum incoming product and an aggregate query to sum outgoing product then joining the two to Products table and subtract. Review http://allenbrowne.com/AppInventory.html. Calculating a starting value would mean determining these aggregate values up to a specified date. Methods could be nested aggregate subquery or DSum() domain aggregate in textbox on report in the Item group header.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    PRyan's Avatar
    PRyan is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2017
    Posts
    6
    Thanks for the replies.

    The stock would come from another query which would sum all stock batches in different warehouses for each item.

  5. #5
    PRyan's Avatar
    PRyan is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2017
    Posts
    6
    I`ve managed to do this running sum using queries and macros, I`ve never tried to learn code although I have used it in the past if I can`t do something the easy way.
    If anyone wants to know how I did it I`ll be glad to tell as I was quite pleased with myself and it only took me all day.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 09-14-2015, 06:05 PM
  2. Running total
    By edwardcga in forum Reports
    Replies: 1
    Last Post: 11-28-2013, 12:04 PM
  3. How do I create a running total
    By dniezby in forum Access
    Replies: 5
    Last Post: 04-13-2013, 11:42 AM
  4. Running total
    By lololthis in forum Queries
    Replies: 5
    Last Post: 06-21-2011, 04:14 PM
  5. Using running total in query to create graphs
    By maggioant in forum Queries
    Replies: 4
    Last Post: 10-02-2009, 05:58 AM

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