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!

Update 1 table with second table values

Status
Not open for further replies.

shaddow

Programmer
Mar 22, 2001
1,862
RO
I have 2 tables
table1
id-auto
amount-number
rest-number

table2
id-auto
id_table1-number
qty-number

First table it's related with second table 1 to many.
I add an record to table 2 and what i want it's to automaticaly if it's posible to update the rest from the first table

I'm using Access Forms to add a record, and i want to make a querry that updates the value in the first table.

sum(qty) group by id_table1 should go to rest in table1.

Couldnt find an elegant solution other then codding the update.



________
George, M
 
Hi,

Unless there is a good reason for storing the total, this is not good practise. Just store table2, and use DSum/DCount functions or Group By on reports.
That is because it is all to easy to get the two out of sync, and as a result you have to ask "which is correct?"

This removal of calculated values is part of the process known as normalisation in database speak.

John
 
Yes, i'm using that solution now, but i was thinking if it could be done this way.
Maybe i was thinking to much on this ideea :)

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top