Declaring variables

  • Thread starter Thread starter Del
  • Start date Start date
D

Del

What is the difference between the following declarations if I put them in
the Declaration section of the module?

Private intVariable as Integer
Dim intVariable as Integer
 
Del said:
What is the difference between the following declarations if I put them in
the Declaration section of the module?

Private intVariable as Integer
Dim intVariable as Integer


In a Class module (includes form/report modules), Dim is the
same as Private.

In a Standard modulem Dim is the same as Public.

Regardless of that, it is a good practice to always use
either Public or Private to avoid any confusion.
 
Back
Top