Subform Entries into 1 Main Form Field

Subform Entries into 1 Main Form Field

I have a subform lookup where a user selects a code.  I need the string value of the code selected for each row in the subform to post in a main form for printing.

I've tried subform variables but either I get duplicate entries of the code or just the value of the last code selected. 

Sample code that kind of works but stores wrong data if user selects a wrong value...it adds the value for each input:
r = "";

for each RCRA_Code in input.Manifest_RCRA_Codes
{
    n = input.RCRA_Codes_Print;
    r = n+" "+RCRA.RCRA_Codes;
   
}
input.RCRA_Codes_Print = r;