I have problem:
why not work ?
please!
Code:
'Form1
Private Sub Command1_Click()
MsgBox a
MsgBox b
End Sub
'Module1
Public a As String
Public b as string
a = CStr(Form1.Text1.Text)
b = App.Path
Printable View
I have problem:
why not work ?
please!
Code:
'Form1
Private Sub Command1_Click()
MsgBox a
MsgBox b
End Sub
'Module1
Public a As String
Public b as string
a = CStr(Form1.Text1.Text)
b = App.Path
yes, put to Form_Load is work.
But how to share that "a" "b" string in all form(s).
how about this styles: ? same
Code:
'form1
Private Sub Command1_Click()
MsgBox astr
End Sub
'module1
Public Function astr() As String
astr = "module1 string"
End Function
You can use sub main() also.
Code in a module:
Code:'~~~ You have to set the Startup object (Project menu --> Project Properties --> Startup Object) to "Sub Main"
Option Explicit
Public a As String
Public b As String
Sub main() '~~~ Execution of the program starts here
'~~~ Initialize values
a = "Hello"
b = App.Path
Form1.Show '~~~ Display Form1
End Sub