With regard to the above, thanks anyway lads, i've used Richard H's script instead which did the job.

Thanks a million