I have played about with this code and it is now working.

Thank you so much for your assistance