You need to close the database objects before setting the object to Nothing (I assume you mean "Nothing" rather than "Null"). Setting the object variable to Nothing releases the variable, but it doesn't actually close the object. You need to first close the object, and then set the variable to Null.
But you also need to make sure that the object exists before attempting to close it. Otherwise, it'll trigger an error.
The code I use (for a recordset object called "rs," for example) is this:
If Not rs Is Nothing Then rs.close
Set rs = Nothing
That should resolve your problem. And you should be using Execute rather than RunSQL.
In any case, I think that's a separate issue from what's being discussed in this thread.
Thanks nrgins... I am explicitly closing all recordset objects (before setting the variable to Nothing) but I'm not attempting to close the CurrentDB object ( I guess that it wont let me do that!!??)
As for your second point... I'm not sure that it is a completely separate issue... I am seeing both issues and to my mind... if Access is not closing connections properly it maybe that locks are being left in place too??