Next Task is Null

Next Task is Null

i have a section that was built by someone else.
when the emails go out, the Next_Task_Template Record displays as a null value.
I believe it is due to a line "Found_Current = "No"
If "Found_Current" is just a variable with a boolean, and with in the next loop "Found Current"="Yes",
then why does the inner loop not run?
All this script is doing, is checking to see if when changes are made, the next task email gets sent to the next person.
When I use the "Info" is states records are empty.
any suggestions on how to re write or work around?
code:
CC_To = "";
Project_Manager_Record = Employees_Information[ID = input.Project_Manager];
Salesperson_Record = Employees_Information[ID = input.Salesperson];
Company_Record = Company_Names1[ID = input.Company_Name_lookup];
Company_Address_Record = Contacts[ID = input.Company_Contacts_Sites];
Job_Order_Record = Job_Order[ID = input.Job_Order_lookup];
All_Rows_Complete = "Yes";
Task_Other_Than_Open_Complete = "No";
for each  row in input.Project_Tasks_subform
{
Status_Record = Project_Status_Choices[ID = row.Task_Status_lookup];
if(Status_Record.Status != "Complete")
{
if(All_Rows_Complete = "Yes")
{
input.Next_Task_lookup = row.ID;
}
All_Rows_Complete = "No";
}
if(Status_Record.Status == "Open")
{
//do nothing
}
else
{
//Will mark the Project Status as In Progress at the end of this script
Task_Other_Than_Open_Complete = "Yes";
}
Current_Task_Template_Record = Project_Tasks_Template[ID = row.Project_Task];
Current_Assigned_To_Record = Employees_Information[ID = row.Assigned_To];
if(Current_Assigned_To_Record.ID = null)
{
Current_Assigned_email = "no email";
}
else
{
Current_Assigned_email = Current_Assigned_To_Record.CO_Email;
}
row.Calendar_Display=input.Project_Name + " " + Current_Task_Template_Record.Task;
Original_Task_Record = Project_Task_Subform[Project == row.Project && Project_Task == row.Project_Task && ID == row.ID];
if(row.Email_Next_Task_Owner = "Yes")
{
if(Current_Assigned_email.contains("@"))
{
CC_To = Current_Assigned_To_Record.CO_Email;
}
row.Email_Next_Task_Owner="Done";
Found_Current = "No";
for each  next_row in input.Project_Tasks_subform
{
if(Found_Current = "Yes")
{
Next_Task_Record = Project_Task_Subform[Project == next_row.Project && Project_Task == next_row.Project_Task && ID == next_row.ID];
Next_Task_Template_Record = Project_Tasks_Template[ID = Next_Task_Record.Project_Task];
Next_Assigned_To_Record = Employees_Information[ID = next_row.Assigned_To];
if(Next_Assigned_To_Record.ID = null || Next_Assigned_To_Record.CO_Email = null)
{
Next_Assigned_email = "no email";
}
else
{
Next_Assigned_email = Next_Assigned_To_Record.CO_Email;
}
Found_Current = "Yes";
}
if(next_row.Project_Task = row.Project_Task)
{
Found_Current = "Got Next";
//info next_row.Project_Task;
//info row.Project_Task;
//info row.Due_Date;
// came up equal
}
}
if(Next_Assigned_email != null)
{
if(Next_Assigned_email.contains("@"))
{
Send_To = Next_Assigned_email;
//Send_To =
/// Send_To =
sendmail
[
from :zoho.adminuserid
to :Send_To," "
subject :"Project: " + input.Project_Name
message :"<div><b>Project: </b>" + input.Project_Name + "<br><b>Job Order: </b>" + Job_Order_Record.Job_Order + "</div><b>Project Manager: </b>" + Project_Manager_Record.Employee_Name + "/" + Project_Manager_Record.CO_Email + "<br><b>Company:</b> " + Company_Record.Company_Names + "<br><b>Company Address:</b>&nbsp;" + Company_Address_Record.Address + " " + Company_Address_Record.City_State_Zip_text + "<div><br></div><div><b><i>" + Next_Assigned_To_Record.Employee_Name + " your task on this project needs your attention. </i></b><br><br><b>Task:" + Next_Task_Template_Record.Task + "</b><i><br>&nbsp;<b>Due Date:</b></i></div><div><b><br></b>========================================================<br>The previous task was:&nbsp;" + Current_Task_Template_Record.Task + " assigned to:" + Current_Assigned_To_Record.Employee_Name + " \n" + Current_Assigned_email + "</div><div><br></div>"
]
}
}
}
}
Project_Status_Record = Project_Status_Choices[ID = input.Project_Status_lookup];
if(Task_Other_Than_Open_Complete = "Yes" && Project_Status_Record.Status = "Open")
{
Progress_Status_Record = Project_Status_Choices[Status.contains("Progress") && Used_On == "Both" || Used_On == "Project Main Form"];
input.Project_Status_lookup = Progress_Status_Record.ID;
}
if(All_Rows_Complete = "Yes")
{
input.Next_Task_lookup = null;
input.Project_Status_lookup = Status_Record.ID;
}