the easiest way would be to make the variable a task var, so it’s “visible” in the whole application. But that’s not a good or elegant approach.
The better way would be to create a public method (starting with the $) in the second form, to make it accessible from outside, i.e. $setmyvalue with a parameter of the required type. And then call it from the first form
Hope that helps