Quote:I have tried it but it giving me errors
To get help on this, show code and error messages with position, or describes errors.
Quote:Now the question is how we should adjust the Sold Items from the table.
Option 1 - Should we deduct 10 from the first record and 10 from the second record?
Option 2 - Should we deduct 15 from the second record and 5 from the first record?
It is your design choice. Both options are possible, it is just your design choice, we can't do it for you.
The fist option is something known as "FIFO".