Hmmm... Here is an idea:
- add class module to your project
- define all of your public variables in the class instead of module
- declare public object variable as that class in the module
- rest should be the same except that you will your object variable instead of form name:
Code:
'in the class:
Option Explicit
Public var1 As String
Public var2 As String
'in the module:
Option Explicit
Public myClass As Class1
'in the form:
Private Sub Form_Load()
Set myClass = New Class1
myClass.var1 = "Hello!"
myClass.var2 = "Goodbye!"
End Sub
Private Sub Command1_Click()
MsgBox CallByName(myClass, Text1.Text, VbGet)
End Sub