Adding records to subform problem

Adding records to subform problem

I am new to Zoho.  Attempting to add records to a subform (Lab_Result_Details) after editng a field in the subform.  Not getting ID from parent form (Lab_Results) to show up in child form.  Here is my code:

//Capture  form ID number to insert into new subform record as linking field
var_ID = input.ID;
//Get ID of test name to enter in new record
var_TestID = frmTests[Test_Name = "ANA"].ID;
//Add record to Details subform and insert ID of parent form into child linking field and test code into test field.  
insert into Lab_Result_Details
[
Added_User=zoho.loginuser
Test_Name=var_TestID
PatientLabResults=var_ID
]

Thank you for any ideas. 
Dr. Schnitz