Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runnning Sum 1

Status
Not open for further replies.

kutibo

MIS
Dec 19, 2000
22
US
How can I calculate a running sum in a form? I have a beginning balance and entiries. I want to add each entry to the beg. balance and display the answer for each subsequent record. For example, if the beginning blance was 100, and each entry was 100. The results would be: 200, 300, 400 etc. Thank you for your assistance.
kutibo


 
Hi there,

to run a calculation based on unbound text boxes (entries), you need to create a private sub X() and some declarations:

Dim One as integer
(just depends on how many text boxes/entries you have)

then

One = textbox1
etc...

txtBalance = One + Two + etc..

After that, on the event procedure of txtBalance (the text box that holds the balance value), call the sub procedure (X), for exp. on click.

Good luck!

 
Thanks for your help and sorry i didn't explain this better. The entries are grouped. They are grouped by with a combination of two fields which are numbers. So the number of entries vary from group to group. So that method won't work well. I tired dsum but that won't do it. I also used sql, which worked, but i need to be able to create new records so i can't use a query. Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top