I had a very similar thing happen to me in a click event of a command button and a form. I did not have any IF statements however. Most of the code was Select Statements and the debugger would get about half way throught the code and then jump to the bottom and I couldn't do anything about it. I cut out the object code from the scx and recompiled and still it didn't work. I even rearranged my code but I still had the same problem. I hope you find a solution becuase I never did and it took much longer to debug that code becuase of it.
Rip Ryness
International Falls, MN