Instead of the [b]IF[/] statement use something like this:

Code:
do until rs.eof
<code here>
loop