Sam

And do you know what? That (with 5 minutes of messing about) totally worked.

So the problem is in the (horrible, legacy, inherited... ) code I'm dealing with.

Thank you for that! It gives me a line of attack, at least. Should have tried it ages ago!

Mike