That's it, thank you jamesd.

I have looked at that code so many times, but when you don't know what you're looking for it's just a jumble of words. Having said that, I'm kicking myself for not searching for 'focus'.