I have a prob. returning values from a Subroutine in Access 2000. I thought that the default was to pass ByRef which would allow the called routine to change the value which would allow the calling routine to see the new value.
I am coding:
but the ReturnValue in the Click routine never gets the new value. I have tried it with and without ByRef, tried diff. var. types, including leaving it as a variant, with no sucess.
Am I doing something wrong, did I misunderstand the help on this, or is there a bug in 2000? I know I could define the above as a Function instead but the case I'm really coding would require several values returned.
Any help greatly appreciated.
I am coding:
Code:
Option Compare Database
Option Explicit
Private Sub Command0_Click()
Dim ReturnValue As String
TestReturn (ReturnValue)
End Sub
Sub TestReturn(ByRef ReturnValue)
ReturnValue = "Hi"
End Sub
Am I doing something wrong, did I misunderstand the help on this, or is there a bug in 2000? I know I could define the above as a Function instead but the case I'm really coding would require several values returned.
Any help greatly appreciated.