Question:
how to update one table using another table in visual basic 2008?
suhail
2011-03-25 01:51:46 UTC
i am creating a bank database account in vb2008.i have 3 tables in bank accounts database,created this database in ms access.and added that tables to my project.i want to,first table is accounts and second tables is investment.and third is withdraw.
i created one row in accounts,then i created one row in investment using same account number,i want automatic update my first table using second table.i mean first table's balance column wants to update by investment's amount + accounts balance;
first table's accno is primary key,in investment table accno is foreign key
how to do this.....plz helo me
Three answers:
Satya
2011-03-25 12:12:25 UTC
Databases have triggers which function like event listeners on a table. These could be set on events like on-row addition, on column change etc. I sincerely don't remember if MS Access 2008 has triggers and support to what level. But explore there.

basically you will need to handle an event that will update the First tables row based on the Account number and increment the Value.



You may need another table for maintaining events in sequence for user accounting. Like 500 Current balance and 2 events of Invst. 200 , and withdrawal 100 will cause 600 in the current balance. But giving a UI view , you will need to trap these in another table as events which you can use to show to your customer in a row like tabular manner for better understanding of his Accounts !!
?
2016-11-15 00:45:33 UTC
one thank you to try this immediately is to stipulate a series off: CREATE set off insertDate AFTER INSERT OF someTable REFERENCING NEW AS inserted for each ROW start up ATOMIC replace someTable SET someDate = NOW() the place IDcolumn = inserted.IDcolumn end observe that this could have a overall performance impression in case you insert super numbers of rows on the comparable time. additionally, your syntax could selection slightly (exceptionally wrt NOW).
AbakeLite
2011-03-25 01:57:27 UTC
May be you can try something like 'on change' event. See other events too that suit your need.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...