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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add new record from previous

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Hi,

what I need to do is be able to add a new record to the mdb depending on what is in the previous record.

so for eg:

first record: balance=$0
previous record: add $40 balance=$40
new record: add $10 balance=$50

this is the code I have attached to an OK button:

rsRecordSet.Source = "Select * From log_deposit"
rsRecordSet.ActiveConnection = connConnection
rsRecordSet.Open
rsRecordSet.AddNew
rsRecordSet("Period").Value = txtperiod.Text
rsRecordSet("Date").Value = txtdate.Text
rsRecordSet("Balance").Value = rsRecordSet("Balance") + txtamount.Text
rsRecordSet.Update

So if anyone knows how to do this, pls reply :)

Thanks.
 
I would be tempted to either keep the running total in another table (as a single figure), or calculate it when you need it. Doing it your way would be a bit of a pain if you altered a value halfway down the chain wouldn't it. Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top