Help with my subforms

Help with my subforms

I currently have a form called Documents in which I have several check boxes, when the boxes are ticked the code will allow for a date and upload field to be shown in the application.
I would like to use this as a sub form but when I load the application with the Documents as a sub form it doesn't carry over any of the code. So all of the fields can be seen.
It would be a big help if anyone could assist me with this problem.
Thanks! :)