vis781,
Thanks for the reply, sorry it took me so long to get back to you about it, work got in the way.
As to the vagueness of my question, I can only put that down to the fact that I had been staring at the same piece of code for four hours trying to spot the fault. The old brain was...