Graham,

with a few tweaks this has worked perfectly thanks