Passing By Reference
Posted on 2004-11-30
Please check the following code:
Sub Click(Source As Navigator)
Dim cMIPScale( 1 to 7, 1 to 2 ) As String
Dim vMIPScale As Variant
cMIPScale( 1, 1 ) = "Location"
cMIPScale( 2, 1 ) = "Grade"
vMIPScale = CheckMIPScale( cMIPScale )
Function CheckMIPScale( tMIPScale )
CheckMIPScale = ""
'== Statements to check the view
'== and start filling the rest of the
'== array from (3 to 7, 1 to 2 )
CheckMIPScale = tMIPScale
What I'm trying to do here is, when user press the button UPDATE, the button will declare an array and initiate 1st and 2nd elements then pass the array to the function. Now the function based on the 2 elements will search a view and fill the rest of array elements ( from 3 to 7, 1 to 2 ) and return array to the SUB who called the function. I used the Debugger and it stopped at the statement "vMIPScale = CheckMIPScale( cMIPScale )" saying Type Mismatch. Seriously I've read the Notes help before posting here but couldn't solve it. Any help would be appreciated. and if there's a better way to do it, I don't mind at all.
Many thanks in advance.