I have a form.
I thought I could put a "global' variable in my form code, right under the "Option Explicit" line, like this:
Private boolVar As Boolean
But when I try to access this variable in any of the subs coded behind that form (for instance in a button-click handler), I get a "variable not defined" error.
Is it necessary to create a module just to make a global variable?
(I mean, global to the form, I don't need scope beyond the form. The whole project is just one form).
I thought I could put a "global' variable in my form code, right under the "Option Explicit" line, like this:
Private boolVar As Boolean
But when I try to access this variable in any of the subs coded behind that form (for instance in a button-click handler), I get a "variable not defined" error.
Is it necessary to create a module just to make a global variable?
(I mean, global to the form, I don't need scope beyond the form. The whole project is just one form).