Also, you have to put actual global variables in a Module, not in a Form. Your best bet is to alter your project to use Startup Object "Sub Main" rather than a form. To do that, create a module, put in a subroutine named "main" that loads your initial form, then put your globals in front of that. In the Project Explorer, right click on your project (top level of the project tree) and select "Project1 Properties...". Then select the module from the Startup Object drop-down in the General tab.
Just to get you going, here's some sample code (assumes a Module named Module1 and a form named Form1):
' This is in Module1
Public myString As String
Sub main()
myString = "Joe"
Dim myForm As Form
Set myForm = New Form1
myForm.Show
End Sub
' This is in Form1
Private Sub Form_Load()
Me.Caption = myString
End Sub
Good luck!
BitBlt
Practically a Posting Shark
894 posts since Feb 2011
Reputation Points: 482
Solved Threads: 148
Skill Endorsements: 14
Question Answered as of 11 Months Ago by
jhai_salvador,
hkwhitten
and
BitBlt