I don't have the time to read through all of your code. Couple of things, when you reply to this post, post the code from on and around line 518 (I imagine that code will have to do with looping through a record set) and secondly this error normally appears when you have logic that looks similar to this code:
Do While Not rs.EOF
If <condtion>
Do something
Loop
End if
Notice that Loop exists inside of the if statement. If you tried to run this code you would get the same error.
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========