Results 1 to 6 of 6
  1. #1
    chavez_sea is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    105

    Running sum in query

    Good day,


    I have a form that calculates running sum when inputting data into a cash account table. There is an expenditure , and a deposit column, and I would like to run a query that would give me the running sum also, so I can run a report showing the entire cash book with running balance. There is a Autonumber field to keep record of the transactions. THis is what I have in the running sum field on the form : RunSum([Form],"Payment FIle No",[Payment FIle No],"Deposit")-RunSum([Form],"Payment FIle No",[Payment FIle No],"Amount")
    Any help or alternative method would be appreciated.

    Thanks Cristina

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    So you have custom functions that do the running sum on form - did you try these in query?

    Report textbox has RunningSum property. That's the easiest approach for what you want.
    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.

  3. #3
    chavez_sea is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    105
    That code was given to me. I dont know to write it. When I put that in the query it shows up an error.
    Can you give me detail instructions.

    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I don't know purpose of argument for which the [Form] parameter is provided. Would have to see the function code. Suggest you instead explore the RunningSum property.
    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.

  5. #5
    chavez_sea is offline Competent Performer
    Windows 7 32bit Access 2007
    Join Date
    Feb 2011
    Posts
    105
    The purpose of the code in the form is to show the cash balance after the expenditure transaction. WOuld I please be allowed to send a copy of the dbase.
    Thanks

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Running sum is not simple in form and query. A total at bottom is easy.

    One method for running sum using DSum https://support.microsoft.com/en-us/kb/290136 - be aware domain aggregates can perform slowly.

    Do web search for more info.

    To provide files, follow instructions at bottom of my post.
    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.

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

Similar Threads

  1. Query with a running sum
    By is49460 in forum Queries
    Replies: 3
    Last Post: 09-07-2013, 11:11 PM
  2. Running sum in Query
    By rkalapura in forum Queries
    Replies: 4
    Last Post: 04-03-2013, 01:05 PM
  3. Query not running
    By gwboolean in forum Queries
    Replies: 2
    Last Post: 08-07-2012, 02:38 PM
  4. Re-running the same query
    By ashok in forum Access
    Replies: 5
    Last Post: 06-19-2012, 10:41 AM
  5. Running a query
    By scarlettera in forum Queries
    Replies: 3
    Last Post: 04-04-2011, 01:59 PM

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