Thanks for your reply dbasnett

As I mentioned, I am a newbie to .Net, so I am probably not seeing something obvious, but I tried your code and it just loops continually.

I notice you don't use the x integer ... could it be something to do with this?

Thanks again for your help though.