Use set field by name to enter the value on the other table. (and make sure you select the correct record on the other table before you use set field by name to enter the value.)
Your set field by name step might look like this:
Set Field By name ["Table2::" & $code1 ; //your value or expression to calculate a value goes here ]
Thanks Phil - I didn't have the correct structure for my Set Field by Name line in my script. Followed your guide and it worked.
(I am going to put this scenario in a loop, so will be going through all records systematically from record 1.)