Hey

Write a Pre-Insert trigger in the detail block and assign the master value to the detail item..