Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enclosed function in ACCESS query PROBLEM! Help!

Status
Not open for further replies.

wascom

Programmer
Jun 28, 2003
7
DE
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.
 
Asked and answered yesterday.


see thread709-589039.


If you have additional information to present, of the previous response is unacceptable, it is generally beter to continue to post in the original thread, as others will have the benefit of the continuing commentary. Simply re-posting will often just get another copy (or minor variation) of the previous answer.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top