I am trying to use the function (enclosed in another function), which I created in VBA in one Query, but I constantly get the Error - Undifined Function. I think there is a problem about ARRAY in this function, but it works as expected in VBA, not in Query.
There is a small example of what I what I am trying to do:
Function TestFunction(ParamArray TestArray()) As Double()
Dim i%
ReDim TempArr(UBound(TestArray)) As Double
For i = 0 To UBound(TestArray)
TempArr(i) = TestArray(i)
Next i
TestFunction = TempArr
End Function
Function Konvert(TempArray() As Double) As String
Dim k%
Dim strng As String
For k = 0 To UBound(TempArray)
strng = strng + CStr(TempArray(k)) + ";"
Next
Konvert = Left(strng, Len(strng) - 1)
End Function
QUERY:
Test: Konvert(TestFunction(0,5,10,20,30,40,100))
The result should be as String: "0,5,10,20,30,40,100"
It works withing VBA, but not in a query.
Many thanks for help.
There is a small example of what I what I am trying to do:
Function TestFunction(ParamArray TestArray()) As Double()
Dim i%
ReDim TempArr(UBound(TestArray)) As Double
For i = 0 To UBound(TestArray)
TempArr(i) = TestArray(i)
Next i
TestFunction = TempArr
End Function
Function Konvert(TempArray() As Double) As String
Dim k%
Dim strng As String
For k = 0 To UBound(TempArray)
strng = strng + CStr(TempArray(k)) + ";"
Next
Konvert = Left(strng, Len(strng) - 1)
End Function
QUERY:
Test: Konvert(TestFunction(0,5,10,20,30,40,100))
The result should be as String: "0,5,10,20,30,40,100"
It works withing VBA, but not in a query.
Many thanks for help.