This is the kind of programming we all love- although it does leave you with a spinning brain.<BR><BR>First off, a little background. My db table looks like:<BR><BR>ID---Description---ParentID<BR>1,Music,0<BR>2,Rock,1<BR>3,Jazz,1<BR>4 ,Punk,2<BR>5,Metal,2<BR>6,Films,0<BR>7,Horror,6<BR ><BR>Hopefully you get the idea, its a tree table you see, with the ParentID column being the ID of that nodes parent. Confused yet?<BR><BR>Well, I put the table into a 2d array using Getrows() and called that array NodeArray. 0 is the ID number of the root of the tree, so the recursive funciton is fired off with GetNode(0).<BR><BR>sub GetNode(code)<BR> <BR> for i = 0 to ubound(NodeArray,2)<BR> if NodeArray(2,i) = code then<BR> Response.Write("&#060;ul&#062;")<BR> Response.Write("&#060;li&#062;"& NodeArray(1,i) &"&#060;/li&#062;")<BR> &#039;Recurse<BR> call GetNode(NodeArray(0,i))<BR> Response.Write("&#060;/ul&#062;")<BR> end if<BR> next<BR>end sub<BR><BR>Its a simple enough function, but is sending me wild a bit. The problem is, the for loops dont seem to be maintained after each backward recurse (where one recursion is completed).<BR>So I end up with something like:<BR><BR>Music<BR>:::::Rock<BR>:::::::::Punk<B R><BR>And then it closes all the &#060;ul&#062; tags correctly... Odd, eh? I did a little debugging, and found that it doesn&#039;t follow the "next" if it has just come out of a dead end. Any clues?<BR><BR>It should look like:<BR>Music<BR>:::::Rock<BR>:::::::::Punk<BR>:: :::Jazz<BR>Films<BR>:::::Horror<BR><BR>and so on, although I know it doesnt look *exactly* like that.