T
Tcs
I'm going back thru my recent code, trying to...ahh..."clean it up", as pertains
to DAO database and recordset objects.
In a given module, my first function is public, then my subsequent functions are
private, only for use by the preceding public function.
While going thru my code to make my changes, I've noticed that I have the
following situation:
I'll set my database object in the main (public) function (to execute queries,
etc.), then may set it again when I call one of the private functions if I want
to open a recordset. (I'll normally close the recordset, before leaving the
private function.)
Is this okay? Should I call my database and/or recordset object "1" or "2" if I
haven't closed the previous one (instance)? Or is VBA taking car of this for
me? This is probably a really basic (no pun intended) question, but I don't
"know". My code seems to run okay, but I don't know if I'm just..."lucky".
I appreciate your input, thanks in advance,
Tom
to DAO database and recordset objects.
In a given module, my first function is public, then my subsequent functions are
private, only for use by the preceding public function.
While going thru my code to make my changes, I've noticed that I have the
following situation:
I'll set my database object in the main (public) function (to execute queries,
etc.), then may set it again when I call one of the private functions if I want
to open a recordset. (I'll normally close the recordset, before leaving the
private function.)
Is this okay? Should I call my database and/or recordset object "1" or "2" if I
haven't closed the previous one (instance)? Or is VBA taking car of this for
me? This is probably a really basic (no pun intended) question, but I don't
"know". My code seems to run okay, but I don't know if I'm just..."lucky".
I appreciate your input, thanks in advance,
Tom