Transferring values from one table to another

I am trying to transfer a company name from a company table to an invoice table.
The user clicks on a checkbox to select a row in the company table to get the selected company name ("compname"). I then want to transfer that value to all rows of the compname field in the Invoices01 table.
I am attaching a screen shot of the code I am trying to run. It won't run because of error messages.

What is the error message? Does the Invoices01 table contain the "compname" column? Just to be sure

Yes, Invoices01 has a field "compname".
I am attaching the error message. I always find these a bit unscrutible.

Scott: I got this thing to work. The code is attached.
You have to create just on memory variable at a time and use it immediately.