How to get difference of two values in same field and update another table
1 have two tables
Table1
Field_1 – Item_ID
Field_2 – On_hand_quantity Table-2
Field_1 – Record_ID
Field_2 – Item_ID
Field_3 – Received
Whenever there is an entry in the table2 the quantity will be added to the table 1 Quantity field matching to Item_ID. This is fine when adding or deleting an entry from the table2 using evnts for adding new quantity I use
$sql="update inv_product set On_hand_quantity=On_hand_quantity+".$values["Received"]." where Item_ID='".$values["Item_ID"]."'";
customQuery($sql); in the “After record added event” Now my question is when editing the table 2, I want to add the difference of the value put in the 'Received'
field (new value – Old Value) to the table 1 for updating
What is the script in which event to be used? Regards