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

Account balances and transactions database (update only balance field)

Status
Not open for further replies.

Simon22

Technical User
Feb 1, 2001
54
CA
Hi all,
I am making a simple database to keep track of my credit cards and accounts. There are two tables: Accounts and Transactions.

Accounts:(Acct_ID, Acct_Name, Acct_Bal)
Transactions:(Trans_ID, Trans_date, Trans_Amount, Acct_ID)

I would like to create a form in which I enter the transaction information which then saves the transaction to the Transactions table and then updates the related Acct_Bal.

I have no problem getting the transaction to save to the Transactions table but I have no idea how to update the related Acct_Bal. I figure the expression might be something like (I don't know much programming so the syntax probably isn't corret):

Accounts!Acct_Bal = Accounts!Acct_Bal + Form!Trans_Amt
where Accounts!Acct_ID = Transactions!Acct_ID

Anways, that was just to give you an inkling of what I want to do. It is probably completely wrong.

Thanks for your help
 
Well, since acct balance is a calculated field, it really shouldn't be stored in your database at all. (The Account balance is just a sum of your transactions, right?)

Instead, you can have a query which shows the account balance as a sum of the transaction table for the appropiate account. Maq B-)
<insert witty signature here>
 
Sounds good. I did not know that calculated fields are not acceptable in tables. Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top