Thanks. Much appreciated. It works perfectly.
I just had one more question how do I prevent duplication of Payslips if the the same timesheet is updated.
I want to make sure the data is updated. Currently every time I update the timesheet a new payslip with the same title is created.