You could open a second window, change it to the right table, set the field, close the window.
Yes, and I have done that but it looks messy. Imagine advancing through several records in the first window and having that second window blink open and shut each time. Very ugly.Unless there's a better way I'll do it from the one window, freezing the script, changing layout then coming back again to the original layout.
But what is the relationship between table 1 and table 2? one to one? one to many? or ???
If it's one to one, why do you need two tables?
If it's not one to one, there are problems with what you want to do here as there could be many records in table 2 related to one record in table 1.
A many to one relationship, on the other hand, may make sense, but it's also possible that you can get the results that you want without using any script at all. It depends on what you are trying to do.