Fetching data from a related form

Fetching data from a related form

I related two fields from related forms with the lookup option,so I get the code for the second form to display the rehab value from the first form but it doesn`t works.Here is the code


if(Property_Analysis1[ID_Operation == input.Property_analysis_I].count() > 0)
{
x = Property_Analysis1[ID_Operation == input.Property_analysis_I];
input.Rehab1 = x.Rehab;
input.Property_address1 = x.Property_Address;
}
Here's the program when it executes the code


If someone could help me I'll really appreciate it