I am trying to run this very simple application ( a form and one button ):
Public Sub Modify(ByRef b As Integer)
b = 167
MsgBox (b)
End Sub
Private Sub Command1_Click()
Dim a As Integer
a = 12
Modify (a)
MsgBox (a)
End Sub
I expect "a" to get modified after calling Modify and for it to output 167, 167.
Instead I am getting 167, 12 (No modification occurs). Do you have any idea why this is happening.
Public Sub Modify(ByRef b As Integer)
b = 167
MsgBox (b)
End Sub
Private Sub Command1_Click()
Dim a As Integer
a = 12
Modify (a)
MsgBox (a)
End Sub
I expect "a" to get modified after calling Modify and for it to output 167, 167.
Instead I am getting 167, 12 (No modification occurs). Do you have any idea why this is happening.