Richard, thanks for the input.

I've made one modification to include a > in the first line of the code I posted above and it's been running fine. But thanks as always for your contribution

Malcolm