Stock Update

Stock Update

Hi,
I have Design No., Shade No. and Meter in Stock
I have multiple entries in same Design No. and shade No. (for Understanding purpose please refer the attachment) 
I am  updating stock when the "Dispatch challan" is updated.

Now
For eg: I have dispatched 40 Meters, Stock should get updated as follows:
            56459>250
                                0.00
                                90.00

But the Stock is getting Updated like :
            56459>250
                                -10.00
                                 100.00

Following is the code i am using

for each  item in Fabric_Details
{
if(Fabric_Stock[Design_No = item.Design_No].count() > 0)
{
Product_Obj = Fabric_Stock[Shade_No = item.Shade_No];
if(Product_Obj.count() > 0)
{
Product_Obj.Meter=Product_Obj.Meter - item.Meter;
}
}
}

whereas,
Fabric_Details = Subform
Fabric_Stock = Stock form
Design_No = Single Field
Shade_No = Single Field
Meter = Decimal Field