0

The question of setting object type variables to nothing has been answered.

I am specifically asking if VARIANTS that are not used as datasets but reference standard variable types (integer, string, boolean, etc) and ones used as a collection as in the "For Each In " need to be set to Nothing.

The closed post as well as all other information I can find on the net is referring to datasets. No other information I can find says anything about other data types. Most of the code examples I see do NOT set the variant to Nothing upon ending a procedure.

When I see examples of variable used as tables, query refs, forms, reports, collections, dictionaries, etc. the specific variable type is almost always set to Nothing after use. Variant data types I see are virtually never set to Nothing.

Original question -- Should 'Variant' variable types be set to 'Nothing' at the end of procedures and functions? If so, should variables passed into the procedures and functions that are also variants be set to Nothing?

I currently have lots of For Each In Collection loops. I have recently been setting them explicitly to Nothing upon exiting the procedures. Should I worry about use of these in the past where they were not set to Nothing?

YukonJJR
  • 1
  • 1

0 Answers0