Sales and Sales Details

Hi folks, am developing POS System using bubble and I have crated data type Sales that include Invoice No and Sale Details that will have line items.
The problem am facing is that how to link Sale Details entry with Invoice No entered in header i-e the Invoice No is created first and then Details for that Invoice are entered.
I can do this from another page by sending parameters to another page but I want both forms to be on the same screen like POS systems do have in comon.
Any idea would be appreciated.
Thanks