Update the Quantity

Guys I have small doubt I had a form1 if I am pressing ctrl+N it opens form2 for create in that new form I had 3 fields ProjId,ItemId,Qty if I am entering data in form2 , so data goes to insert form1
In form1 also 3 fields ProjId,ItemId,Qty
I am enter data in form2 ProjId,ItemId,Qty ; if ProjId,ItemId already exists in form1 then qty is to add there respective previous qty ;
Ex:
Form1
ProjId ItemId Qty
1 2 20
2 3 17
Then form2 entering data
ProjId: 1
ItemId: 2
Qty: 33
In form1 data will change like
ProjId ItemId Qty
1 2 53
2 3 17
this.qty = this.qty+form2.qty
Can any one help me