Thank you to all, both suggestion worked perfectly. I went with a slightly modified version of the function code and added the ability to pass the page to be linked to as an argument in the function call. Once again, thanks Chris