I have a question that I wasn't able to find a nice clear answer to that I am hoping you professionals could shed some light on.
When dealing with recordsets (DAO), when doing error handling if the event the module/process fails, should you apply
If so, why? If not, also why? Should both methods be done, or is one sufficient? I know VBA has garbage collection but want to make sure I am at least attempting to do best practice.
For transparency, the method I think I should use would be something like this:
When dealing with recordsets (DAO), when doing error handling if the event the module/process fails, should you apply
.close
and then set to Nothing
?If so, why? If not, also why? Should both methods be done, or is one sufficient? I know VBA has garbage collection but want to make sure I am at least attempting to do best practice.
For transparency, the method I think I should use would be something like this:
Code:
If Not <insert recordset variable here> is nothing then
<variable again>.close
Set <variable again> = Nothing
End If