How do I get the value of a variable in one form over to another form?
For example, let's say Form1 has a variable in its class module called MyVar1. How can I get that value over to the class module section of Form2?
I tried creating a module, where I declared a new variable (NewVar) at the module level. Then I wrote a Sub Procedure that assigned the public variable the value of MyVar1 (the procedure was called from Form1).
Thing is, I can tell that the application is holding the value of the NewVar as long as the code is running, but when I make refernce to NewVar (e.g. Msgbox NewVar) from Form2, it is empty, or says I have to declare the variable if Option Explicit is set.
Forgive me is I am rambling. I don't feel that I really know how to explain my issue very well. ANy help you can provide is very much appreciated.
For example, let's say Form1 has a variable in its class module called MyVar1. How can I get that value over to the class module section of Form2?
I tried creating a module, where I declared a new variable (NewVar) at the module level. Then I wrote a Sub Procedure that assigned the public variable the value of MyVar1 (the procedure was called from Form1).
Thing is, I can tell that the application is holding the value of the NewVar as long as the code is running, but when I make refernce to NewVar (e.g. Msgbox NewVar) from Form2, it is empty, or says I have to declare the variable if Option Explicit is set.
Forgive me is I am rambling. I don't feel that I really know how to explain my issue very well. ANy help you can provide is very much appreciated.