Auto populate a field value of sub table in Simple list & Details - List grid form

Hello folks,

I am trying to replicate a form same as Item sales tax group form. Now my query is I am using 2 tables one for the header and one for the lines. Whenever I click on the new button for the lines table, it should automatically populate the pk of the header table. I have added a relation between the two table. However I am not sure how do I achieve this? Can anyone please help me.