Auto Populate a field

Auto Populate a field

Hi, Please can you help me with this query

I am trying to update a field in one form with a lookup of another form

var = New_Product [ID==input.Product_Code];
input,Vendor = var.Vendor

Error at line2
Variable 'Vendor' is already defined of data type 'STRING' but trying to update 'BIGINT' data type

Vendor is  lookup in the New_Product form coming from a look up in a third form.

I haev tried following an example form the forum as follows:

  temp = New_Product[ID == input.Product_Code];

               rec = Vendor [ID==temp.Vendor];

               input.Vendor= rec.Vendor;

but this comes up with Vendor is not a form in the application.

Thanks,

Richard