Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Running Balance
David Campbell 
     
2 years ago
The last thing I'm trying to work out on database is the running balance.  I have played around with a lot of different ways of doing it , but seem to have a similar outcome. I put code back to this:

=IIf(IsNull([TransactionID]),"",Nz(DSum("TAmount","CheckRegQ","TransDate <= #" & [TransDate] & "# AND TransactionID <= " & [TransactionID]),""))
Work great unless you need to add an older record and don't run query by date ascending.

if you do use date ascending, it puts in date in right order, then properly adds or subtracts the amount.  After which it adds or subtracts the next record value to the prior value so the new transaction doesn't get calculated into running balance.
David Campbell OP  @Reply  
     
2 years ago

David Campbell OP  @Reply  
     
2 years ago

John Davy  @Reply  
         
2 years ago
Watch Richard's Tech Help   Check Register or the Check Register Seminar

John
David Campbell OP  @Reply  
     
2 years ago
I Solved it.  I made my own auto number for transactionID, then vba to insert the new record and adjust all  all the transactionsID's to keep them in sequence.  Works nicely
Kim Boren  @Reply  
      
2 years ago
David,
I would be interested in more detail of how you solved it.

Kim
David Campbell OP  @Reply  
     
2 years ago
I changed the code to this  after other way i solved it.    =IIf(IsNull([TransactionID]),0,Nz(DSum("TAmount","CheckRegQ","TransDate < #" & [TransDate] & "# OR (TransDate = #" & [TransDate] & "# AND TransactionID <= " & [TransactionID] & ")"),0))   the other way I solved it was to create my ownprimary  key autonumber and incremented it each new record then I created a query to get the transaction ID and add 2 to each transaction ID Then I changed the transaction and its corresponding record since it was the next one in table to the open spots I made.  However I like the correct change in code at begining, its a lot less to type and cleaner.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 10:48:26 AM. PLT: 1s