Thread moved from 'VB6 and Earlier' forum to 'ASP, VBScript' forum

I can see the problem, but is rather hard to spot due to the lack of indenting of your code.

For an explanation/example of how it should be, see the FAQ article What is indenting, and why should I do it?

Once you have indented the code properly, the problem should be clear to you.