G
Guest
Here is what I have:
Private Sub First()
Dim strWriteLine as String
Second(strWriteLine)
End Sub
Private Sub Second(strWriteLine As String)
strWriteLine = strWriteLine & "Other Stuff"
End Sub
The sub First creates the variable strWriteLine and adds data to it. I then
call the sub Second passing the variable strWriteLine. This works fine. When
I stop the code and check the variable it is passed intact. The sub second
adds "Other Stuff" to the variable correctly. The problem is when sub Second
ends an I am returned to Sub First, strWriteLine is back to its original data
as if it was never passed to sub Second. The "Other Stuff" is no longer there.
How can I cause the strWriteLine to retain the "Other Stuff" added to it in
sub Second after returning to sub First?
Thanks.
Private Sub First()
Dim strWriteLine as String
Second(strWriteLine)
End Sub
Private Sub Second(strWriteLine As String)
strWriteLine = strWriteLine & "Other Stuff"
End Sub
The sub First creates the variable strWriteLine and adds data to it. I then
call the sub Second passing the variable strWriteLine. This works fine. When
I stop the code and check the variable it is passed intact. The sub second
adds "Other Stuff" to the variable correctly. The problem is when sub Second
ends an I am returned to Sub First, strWriteLine is back to its original data
as if it was never passed to sub Second. The "Other Stuff" is no longer there.
How can I cause the strWriteLine to retain the "Other Stuff" added to it in
sub Second after returning to sub First?
Thanks.