the two different filenames is a hang-over from when i was trying to sort the problem out last time. i know there's no error checking - i wanted to get the script up and running in a simple form before adding the checking.

Thanks for the tips though, and I'll take a look at KSMS [Smile]