Dynamically populated checkbox

Dynamically populated checkbox

I have 2 related forms. I have a checkbox in form 'A' which is dynamically populated with records from form 'B' to a given search criteria. The user then selects the applicable records shown in this checkbox. This bit works OK but I now want to write a script to automatically update these selected records back in form B.
 
Thanks in advance - A