Formatting error ? 'If' statement

Formatting error ? 'If' statement



I have Three Forms
-Material_Type_Form
-Material_02_Form
-Material_Out_Form - Stateless

there is a look-up field Material_Type_Field in form Material_02_Form, which gets its list from the form Material_Type_Form. 
The form Material_02_Form does calculations for material in, on hold and out and displays the total on hand in a formula field named On_Hand_Field, for convience there is a hidden field, OHH, which is a copy of the output of On_Hand_Field but in string format.

On Material_Out_Form, the stateless form, there is a look up field to the form "Material_Type_Form" to poulate the material list. I would like when I select an item from the drop down list for it to populate the "Available_Field" on Material_Out_Form with the qty available which is held in form Material_02_Form in the OHH field. The Code i have writeen for this is simple and short but it is not working, what am i missing ? 


x  =  Material_02_Form  [ID = Material_Type];
y = x.OHH;
if(y == null)
{
input.Available = "9999"
}
else
{
input.Available = y
}

Thanks in advance

Mike G