data does not update.need HELP pls.

data does not update.need HELP pls.

Sir,
In this apps, I have 3 form and 3 view.

1.stocklist
2.stock in
3.stock out

in "stock in" form I have a field "quantity".each time I submit a value then it should update the value in
stocklist view  field "quantity stock in".Same goes for "stock out" form into "quantity stock out".

Somehow it does not update any value and I've tried it on other record and only certain record is succesfully updated.
I dont know which part im wrong but pls guide me to solve this problem.Before this, the previous version got no problem in doing so.

Below is the code I input in the "stock in" form--> on add --> on succes

  1. q  =  StockList  [Category == input.Type];
  2. if (input.Type  ==  q.Category)
  3. {
  4.     if (input.Item  ==  q.Description)
  5.     {
  6.         if (q.Quantity_Stock_In  ==  0)
  7.         {
  8.             q.Quantity_Stock_In = input.Quantity;
  9.         }
  10.         else if (q.Quantity_Stock_In  !=  0)
  11.         {
  12.             q.Quantity_Stock_In = (q.Quantity_Stock_In  +  input.Quantity);
  13.         }
  14.     }
  15. }