Does this fail every time, or does it work once and then fail thereafter (until you close the form and re-launch it)?
If you have not played with the locals window before, this would be a time to try it. Set a breakpoint on the "Set DB = ..." line and use the locals window to look at the variables to see their states before and after each line is executed. I'm thinking that local variables db and rs will start their existence as "Nothing" and will become something as you single-step your way through the code. If this works the first time through that click event at least as far as getting past the "Set RS = ...." line, use the F5 key to resume execution BUT LEAVE THE BREAKPOINT SET!
If my thinking is correct, this code will fail the SECOND time you execute it - but I'm not 100% certain on this, which is why I suggest the experiment. If I am right, the next time you enter that click routine, you MIGHT have a different finding about what IS and what IS NOT "Nothing."