I want to declare a static variable in a subroutine so it will have scope only for that subroutine. When the form is Unloaded I want the variable destroyed. I am using the Static Keyword like this: Static bAlreadyAdded as Boolean
and it remains static, but it remains static even through an Unload event because when I load the form again the value of bAlredyAdded is being retained.
I have also tried using the Static keyword in the Subroutine like this: Private Static Sub Form_Activate()
but the same thing occurs.
I want to maintain my code clean so I do not want to declare this in the general declarations section. Can someone offer guidance?