Hi All!
The problem is following:
I want to get as QUERY result the value of the function, that uses another function which PARAMETER is ARRAY!!! So there is Function FA(ARRAY()) which returns one more ARRAY as result and there is one more function FB(ARRAY()) which returns STRING Value.
So when I have an ARRAY X(), I have to get as result a STRING that comes as return of FB(FA(ARRAY(X))) !
The problem in ACCESS I faced with is that when a use this function withing VBA it WORKS! But when I try to put this function in a QUERY I get ERROR "Undefined function FA...".
I tried everything and I think there is a problem with ARRAY as FUNCTION PARAMETER.
Below there is a simple example (not the real case) of what I have:
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"
When I write in VBA:
? Konvert(TestFunction(0,5,10,20,30,40,100))
it works. (Not in a QUERY)
Hopefully, someone can help me to solve this problem.
Thank you very much.
The problem is following:
I want to get as QUERY result the value of the function, that uses another function which PARAMETER is ARRAY!!! So there is Function FA(ARRAY()) which returns one more ARRAY as result and there is one more function FB(ARRAY()) which returns STRING Value.
So when I have an ARRAY X(), I have to get as result a STRING that comes as return of FB(FA(ARRAY(X))) !
The problem in ACCESS I faced with is that when a use this function withing VBA it WORKS! But when I try to put this function in a QUERY I get ERROR "Undefined function FA...".
I tried everything and I think there is a problem with ARRAY as FUNCTION PARAMETER.
Below there is a simple example (not the real case) of what I have:
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"
When I write in VBA:
? Konvert(TestFunction(0,5,10,20,30,40,100))
it works. (Not in a QUERY)
Hopefully, someone can help me to solve this problem.
Thank you very much.