When you set rs = Nothing, are you making rs = 0, or rs = Null?
Reply from Richard Rost:
Neither. You're destroying the object completely and removing all references to it from the system memory. See, when you DIM a variable, Access reserves a certain amount of system RAM to hold that value. This memory is supposed to get cleared when you exit the function you're in, however that's not ALWAYS the case, leading to what's sometimes referred to as "memory leak". Now for your average variables, that's not usually a big problem: a byte here, 2 bytes there... but when you're dealing with objects like a Database or Recordset, they can be pretty big, so you want to make sure to MANUALLY destroy (undeclare) the object by setting it to NOTHING. You don't HAVE to, but it's wise.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.