If you got that right, without seeing the actual code where the error occurred, give yourself a prize!
To the OP: It's always best to post the entire code or at least all the code involved in the situation. For instance, if I had a program with 20 subs, but the error as only occurring in one of those subroutines, I'd copy the main, REM out the other sub calls, and copy that sub. Now, others could run the code, re-create the error, and hopefully enlighten me on why it didn't work correctly.
Now go in the kitchen and bake me a pizza. I might need it, to reward Tempo.
Pete