Button to create fields on form

I am trying to create a form that has three fields for the user to fill out and attach a document (PDF). Two of the fields will be categories that the attachment falls into.

Once they categorize the first attachment they may need to add another attachment with a category. They could add up to 20-30 attachments all need to be categorized. All those attachments will be on one Notes document.

How can I create a button that dynamically creates the fields for them to attach a document and categorize it?

Subject: Dynamically remove instead of create

You can have the fields on the form, and remove any empty ones in the QueryClose event. You can hide unwanted additional lines when the contents of a previous line is blank.

That way, you have full edit control as needed, and documents sized as needed. The fields only actually exist when the document is opened, and empty fields are not saved.