Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
1.44/5 (3 votes)
See more:
Hi am trying to do simple bank software. Using front end as VB and back end as ms access. I have 2 table namely "newacount" and "deposit". A newacount contain a fields like accholdername,accnum,ledgeramount, and deposit table contains field accnum and depoamount. Now my question is if I deposit some amount in depoamount field it should update in legderamount field also how can I do that pls help me
Posted

1 solution

Try this in "After Insert Event Procedure" of the "deposit" table:

SQL
UPDATE newacount AS n 
SET n.ledgeramount = d.depoamount
INNER JOIN deposit AS d
ON n.accnum = d.accnum


Another one possibility:

SQL
UPDATE newacount 
SET ledgeramount = d.depoamount
FROM ( SELECT accnum,depoamount FROM deposit ) d
WHERE accnum = d.accnum
 
Share this answer
 
v5
Comments
Maciej Los 7-Sep-15 8:41am    
5ed!
Leo Chapiro 7-Sep-15 8:51am    
Thank you! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900