If you want a variable to be accessible from two forms, then you need to store it outside of the two forms.
These two posts talk about different approaches to this problem: