Need your guide from all experts to complete my form

I am currently working on the withdrawal form.

a. I have created auto deduction from the balance.
Here is my formula for auto deduction for your review: =IFERROR((SUM(VLOOKUP(C7,UHSE!$B:$E,4,FALSE)-G7)+I7),"")
Please kindly educate me if my formula has an error.

b. But i found if i have input duplicate part number in the same form, my balance cannot show an updated balance.
Please educate me what formula can work for my problem.