How do I fetch and input data from parent and child form?

How do I fetch and input data from parent and child form?

I want to transfer data from a parent and it's child form to another form. I drafted this code but it throws an error once it gets to the child form fields. What am I doing wrong?

if(Master_Database[ID == input. Number].count() > 0)

{

                x = Master_Database[ID == input.Number]

                input.Collection_Date = x.Collection_Date;

                input.Status = x.Status;

                input.Code = x.Code;

                input.Other_Source = x.Source_Other;  

input.Request_By = x.PPRequest.Requested_By;

                input.Est_ Date = x. PPRequest.Estimated_ Date;

                input.Amount_Requested = x. PPRequest.Amount_Requested;

}