Option Commands (Option Explicit / Option Base etc) - Scope
"John Green" wrote in message
...
Alan,
Option Explicit only applies to the module in which it resides. All
the
variables used in that module must be explicitly declared using Dim
or one
of its variations (Public, Static, etc.)
Option Base also applies to only the module it is in.
--
John Green
Sydney
Australia
Thanks John.
As a follow up, does it therefore make sense to put all my public
variable declarations into a separate module on their own, and avoid
using public in other modules?
That way, if I only Dim vars in the other modules, I know they only
reside there.
How about forms? Should I also use option explicit in each separate
form, or do they all follow the same command?
Thanks,
Alan.
|