HebieBug -
Variable visibility is called "Scope".
As you've seen, variables created inside a sub or function have what is called "Local" scope. They are visible/accessable only inside the function.
The next layer of scope is to declare varibles as the module level (outside a sub/function). You can use the "Dim" keyword to do this, but a better way would be to use the "Public" and "Private" keywords, as they make it clear as to which is which. It also depends on the type of module as to which (public/private) you can use.
In a class module, public and private are OK. Public variables will be visible outside the class when accessed as an ActiveX property of a class variable. Private variables are only visible inside the class.
In a .bas module, public variables are visible throughout the project (no ActiveX requried). Private variables are only visible in the .bas module.
In a form module, public variables are only visible outside the form when prefixed by a form variable. Private variables are only visible inside the form.
The best thing for you to experience this for yourself is to create a small project -- one form, one .bas module, and one class. In each, create public and private variables. Then run it and see which variables are visible in which situation.
Chip H.