Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15543

VS 2019 [RESOLVED] Where can I initialize an array that can be accessed from the whole form?

$
0
0
I have and array with several labels:
Code:

Dim Lbl_Car() As Label = {LBL_Car_1, Lbl_Car_2, Lbl_Car_3, Lbl_Car_4, Lbl_Car_5, Lbl_Car_6}
I do this so I can loop through the labels and pull information from them or change them at will. The problem is that I have to initialize the array in the same sub that it is used in. I have tried to set it up in a separate sub and call it from other subs with no success. I have tried it at the top of the program with the rest of my dim statements with no luck. Where can I initialize the array once so it is available to the rest of the form?
Thanks

Viewing all articles
Browse latest Browse all 15543

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>