The scope of a variable is from which sections of code it can accessed.
Public Class Form1 Dim Variable_A As string="Hello from A" Public Variable_B as string ="Hello from B" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Variable_C as string="Hello from C" End Sub End Class
In the above example
It is able to be used by all functions and routines inside Form1 but not from outside of Form1 (Local to Form1)
It is able to to used by all functions and routines inside Form1 and from outside of Form1 (via Form1.Variable_A)
It is local to this routine, it can not be access from outside of it or the form.
But suppose you want a variable to be shared between 2 Forms, how?
You can use a module.
Module ShareStuff Public Variable_D as string="Hello from D" Dim Variable_E as string = "Hello" End Module
It is able to be used both inside and outside of Shared stuff.
It is able to to used by all functions and routines inside SharedStuff but not outside it
This is the same for different types not just strings.
I hope this help you to understand where to put things.