I've solved my own problem - the local variable should have been a bool. It is strange however that this program will run on one machine and not on another. I agree with the machine that didn't run it - the program was invalid. Apologies for the interruption Sandy