Enable and disable fields in a subform On Edit - On Load according to an other field value.

Enable and disable fields in a subform On Edit - On Load according to an other field value.

Hi Zoho, 


I have a subform and I would like to know if its possible to enalbe or disable a field "Quantity" according to an other field "Status" for different rows when I open the record to edit it.

I was trying the following code, but I can't even save it.

for each rr in Detalil_RC
{
if ( rr.Status == "Approved" ) 
    {
disable rr.Quantity;
   }

It says "rr" is not defined.

Any help will be appreciated.