View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default error 28: out of stack space call function

Right here, you call test2 from within test2

Function test2(cenomtras As String) As String 'this function give me a
string name

cenonlala = "LALA"

' recursive call here
test2 = test2("LALA")

End Function

Since you don't have any terminating logic in the Function, it continues to
call itself until it runs out of stack space.

--
Regards,
Tom Ogilvy



"ina" wrote:

Hello guys,

I am newbie in VBA and I have an error 28: out of stack space; I do not
understand why :(

Sub test1()

Dim cenom, cenonlala As String

cenom = test2(cenonlala) ' I get this string name to input in my
query

End Sub


Function test2(cenomtras As String) As String 'this function give me a
string name

cenonlala = "LALA"

test2 = test2("LALA")

End Function


Can someone help me?

Ina