how to create public variable

how to create public variable

How do I create a public variable to store information in one form and then use it in another?
I have three default fields in one form that I need to populate in another form. I've tried creating a variable but they are only valid in the form they are created in. Any thoughts?