How do i add (+) a number from a table with another number in a different table on button click?

I have a purchase order table with product quantities and a separate table for inventory, when I click on a button that receives the purchase order, I want the 'Qty' mentioned in the purchase order table to be added with the 'qty' in inventory table for that specific product.
Eg:

  1. I have an inventory table with 100 apples into.
  2. I have another purchase order table with a purchase order for 50 apples.
  3. I click on the row of Purchase Order Table that has 50 the apples and mark it as received.
  4. Status of the purchase order changes to received.
  5. I want the inventory table to automatically change the qty of apples to 150

Done upto 1-4, dont know what to do for that final step.

I currently have a function in-place that marks the order as received.

Any help is appreciated on the query!

@do2 Welcome to the forum.

Do you need to update only the table or the database first?

If you need to update the database first, then reload the table after the db is updated by callinig the query that loads the table.

You can do this by using a an Event handler such as Row click or Row select:
Screen Shot 2022-02-07 at 6.43.29 AM