Sage 300 2017 - Customizing UI Form

Hi

I need to modify the Purchase Order Invoice Entry to allow to input many Receipt at once from a copy paste

The user would open the form, input Invoice Number and VendorNumber manually

Then he would click on a new button to be added to the form.

That button would would a form with a textbox and he wold paste Receipts separated with a newline character and would click ok

VBA code would then add the receipt.

I was able to generate a macro for that.

I edited the macro, added a form and added additional control PO1400,

When I run the macro, it opens the Invoice Entry form and the user inputs the Invoice number and Vendor Number and click "Multiple receipt" 

1) I was able to add a button but not IN THE PO1400  control. Only outside of this control on the form. How to put it WITHIN the 1400 control ?

2) With the button on the form (outside the 1400 control) I called the macro I recorded. The macro was recorded after the form was open to only record the multiple receipts so when the macro runs, it seems to act on another instance of the Invoice form (not the one already open) since it says the it is missing the VendorNumber.

How can my vba code act on the currently open form. I did not change the macro at all. It has everything that was recorded.

Any help appreciated.

Are there any documentation on UI Form Customization ?