Declaring variables

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
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top