
Originally Posted by
dbasnett
...
Thanx, thats exactly what i wanted to know. & to summarize all this:
Code:
'to add module go Project -> add module
'Form1.vb
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim var As String = "Bingo"
Dim var2 As String = "Bingo2"
Test(var, var2)
End Sub
'Module1.vb
Public Sub Test(ByVal myVar As String, ByVal myVar2 As String)
MessageBox.Show(myVar & Chr(13) & myVar2)
End Sub
& another more simple way of diong it:
Code:
'Form1.vb
Public myVar As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
myVar = 1
aModule()
MsgBox(modVar)
End Sub
'Module1
Public modVar As Integer
Public Sub aModule()
modVar = 2
MsgBox(Form1.myVar)
End Sub