Duplicate record in form and related form

Duplicate record in form and related form

I'm looking to create a "duplicate" button. I have a form and a related form. By clicking on "Duplicate" the record of the first form and the linked records of the related form should duplicate themselves. Any idea ?