Problem update field in on update

Problem update field in on update

Hi Harshavardhan ,

Hi,
i have a form without store data. I insert password and populate other two record (Cognome e Nome) with data in table Piloti.

With this script inserted in On click event button:

if (count(Piloti[PASSWORD == input.Password])  ==  0)
{
    alert("Pilot not found");
}
else
{
    rec  =  Piloti  [PASSWORD == input.Password];
    rec.status = "Confirmed";
}













Have a problem similar to quoted one, but i intended do made my script in on User Input Field. So:
1- Have a form named Reservas that users fill in.
2- Several Editors on a single computer have to respond users filling some more hided fields.
3 - I made a form called Pass (labeled Nome and Codigo)

So, I have Reservas form and Pass form.
In reservas form i asigned  two text fields (labeled Codigo_editor and Editor) that 








shows at on edit and invoque 

this

temp  =  Pass  [Codigo == input.Codigo_Editor];
input.Editor = temp.Nome;

works fine when i put data correctelly, but when i put one wrong Codigo , Creator give me this:









Error details:
Error occured while executing on user input script.
Unable to update variable
temp.Nome is null
temp is null


Can you help me?