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

calculation

Status
Not open for further replies.

filipe26

Programmer
Mar 17, 2003
152
PT
hi i have a table1 with a currency field and table2 with another currency field.What i want to do is when i change a record in table1 the record of table2 changes too with the sum of all records of field's table1.Thanks.
 
You can put it in the OnCalc event for table1. Make sure table2 is open before table1. I'm not sure if you acually need a calculated field to trigger this event, but if you do, you could make a calculated sum field in table one and just write that value to table2.

Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
 
You can do an OnCalc like above, or if you're using something like SQL server, I'd put a trigger on Table1 (for update and insert). A server side update would be quicker execution and you can enforce business rules for data validation and integrity.

There are 10 types of people in the world. Those that understand binary and those that don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top