Updating a column in one form from another in a form

Updating a column in one form from another in a form

Hi,

I have a master table where the values of ModelNo, TallyID, SUPC Code are updated. There is another form called Tally Stock where there are 3 columns, Tally id, SUPC Code and Stock quantity. 

Currently these 3 columns are imported from excel, i.e. each and every time, i need to delete the existing all the rows and update it to the table with new values of Stock quantity, but the tally id remains the same. I dont use the submit functionality.

Now i want to update the SUPC Code from the master table.

I created a function and called that in the custom action of the Tallystock report.

Below is my code:

fsn = Products[SUPC_Code != ""];
tallymodel = Sample_TallyStock[SUPC_Code == ""];

for each r in  fsn  
{
if(fsn.TallyID == tallymodel.TallyID)
{
tallymodel.SUPC_Code=fsn.SUPC_Product_Code;
}
}

 But it is not working.
Kindly advise.