Help!! disable and enable input of subform

Help!! disable and enable input of subform

Hello, I have a small problem and I want to disable a field of a subform while it is empty or is null, I try from the Form Action - On Load and from the Field Actions, but I have not been successful, these are the 2 codes that I put:

Form Action - On Load:

if Item.Producto == null
{
disable Item.Valor ;
disable Item.Cantidad ;
}
else 
{
enable Item.Valor ;
enable Item.Cantidad ;
}

--------------------------------------------------------

Field Actions

if row.Producto == null
{
disable row.Valor ;
disable row.Cantidad ;
}
else 
{
enable row.Valor ;
enable row.Cantidad ;
}

Thanks