Ok I'm back, I noticed palblano's response way up there( I didnt ignore it) but in any case.<br><br><font color=blue><br><i>What you could do is create a 'Node' class in your script (yes... object oriented script code) that would be searchable by Node.id the id could be synthesized using HParent.LParent.HID, if I understand your schema correctly. Then as each Node instance is created from a row it's parent could be located in memory and the new Node added to it's children collection. </i><br></font><br><br><br>what I want to know is how would I create the class and how to throw the records into it, right now I have it just doing a getrow.<br><br><font color=blue><FONT FACE=monospace><br>sub showtreeat(byref theObj, HpLoc, LpLoc, ShowP)<br> Dim TreeRow<br> TreeRow = UBound(theObj, 2)<br> if ShowP = true then<br> showparent theObj, HpLoc, LpLoc<br> end if<br> for j = 0 to TreeRow<br> If theObj(HP,j) = HpLoc and theObj(LP,j) = LpLoc then<br> if Spaces = 0 and count > 45 and Change=True then<br> Change = False<br> HTMLStr1 = HTMLStr<br> HTMLStr = ""<br> end if <br> if theObj(RType,j) <> "DataGroup" then<br> If Spaces = 0 then<br> HTMLStr = HTMLStr & "<TR><TD bgcolor=""#000000""><Font color=""white"">"<br> else<br> HTMLStr = HTMLStr & "<TR><TD " & gTableCellColor & ">"<br> end if<br> writetabs(Spaces)<br> HTMLStr = HTMLStr & vbcrlf & "<input type=""" & TheObj(RType, j) & """ name=""" & TheObj(Name, j) & """ value=""" & TheObj(Value,j) & """>"<br> HTMLStr = HTMLStr & TheObj(Label, j) <br> If Spaces = 0 then<br> HTMLStr = HTMLStr & "</Font></TD></TR>" & vbcrlf & vbcrlf<br> else<br> HTMLStr = HTMLStr & "</TD></TR>" & vbcrlf & vbcrlf<br> end if<br> Count = Count + 1<br> else<br> select case theObj(Label,j)<br> case "ESA", "RM"<br> Set objDB = WebConn()<br> if theObj(Label,j) = "ESA" then<br> Set gRS = objDB.EsDataGroup(1)<br> else<br> Set gRS = objDB.ProgCompGroup(1)<br> end if<br> if not (gRS is nothing) and not (gRS.EOF) then<br> gRS.MoveFirst<br> Do While Not gRS.EOF<br> HTMLStr = HTMLStr & "<TR><TD " & gTableCellColor & ">"<br> writetabs(Spaces)<br> HTMLStr = HTMLStr & vbcrlf & "<input type=""" & TheObj(Value, j) & """ name=""" & theObj(HID,j) & "_code"" value=""" & Trim(gRS("codetype"

) & "~" & Trim(gRS("groupcode"

) & """>"<br> HTMLStr = HTMLStr & gRS("grouptitle"

& "</TD></TR>" & vbcrlf & vbcrlf<br> Count = Count + 1<br> gRS.MoveNext<br> Loop<br> gRS.Close <br> end if<br> WebDisConn(objDB)<br> case "O", "IOC"<br> Set objDB = WebConn()<br> if theObj(Label,j) = "O" then<br> Set gRS = objDB.OescodeGroups<br> OccVal = "_code"<br> else<br> Set gRS = objDB.Sicdiv()<br> OccVal = "_ind_grp"<br> end if<br> if not (gRS is nothing) and not (gRS.EOF) then<br> gRS.MoveFirst<br> Do While Not gRS.EOF<br> HTMLStr = HTMLStr & "<TR><TD " & gTableCellColor & ">"<br> writetabs(Spaces)<br> HTMLStr = HTMLStr & vbcrlf & "<input type=""" & TheObj(Value, j) & """ name=""" & theObj(HID,j) & OccVal & """ value=""" & gRS(0) & """>"<br> HTMLStr = HTMLStr & gRS(1) & vbcrlf & "</TD></TR>" & vbcrlf & vbcrlf<br> gRS.MoveNext<br> Count = Count + 1<br> Loop<br> gRS.Close<br> end if<br> WebDisConn(objDB) <br> end select<br> end if<br> Spaces = Spaces + 1<br> showtreeat theObj, theObj(HID, j), theObj(LID, j), False<br> Spaces = Spaces - 1<br> end if<br>next<br>end sub<br></font></font><br><br>these are the other functions used.<br><font color=red><FONT FACE=monospace><br>sub replacelang(byref LangObj, byref AryObj)<br> for w = LBound(AryObj,2) to UBound(AryObj, 2)<br> for x = LBound(LangObj,2) to UBound(LangObj, 2)<br> if AryObj(Label, w) = Cstr(LangObj(LangID, x)) then<br> AryObj(Label, w) = LangLookup(LangObj(LangTab,x), LangObj(LangRadio,x), LangObj(LangType,x))<br> end if<br> next<br> next<br>end sub<br><br>sub writetabs(number)<br> for k = 0 to number<br> HTMLStr = HTMLStr & " "<br> next<br>end sub<br><br>sub showparent(byref theObj, HpID, LpID)<br> Dim ParentRow<br> ParentRow = UBound(theObj, 2)<br> for j = 0 to ParentRow<br> If theObj(HID,j) = HpID and theObj(LID,j) = LpID then<br> HTMLStr = HTMLStr & "<TR><TD " & gTableCellColor & ">"<br> writetabs(Spaces)<br> HTMLStr = HTMLStr & vbcrlf & "<input type=" & TheObj(RType, j) & " name=" & TheObj(Name, j) & " value=" & TheObj(Value,j) & ">"<br> HTMLStr = HTMLStr & TheObj(Label, j) & "</TD></TR>" & vbcrlf & vbcrlf<br> Count = Count + 1<br> exit for <br> end if<br> next<br>end sub<br></font></font><br><br>and the main routine<br><font color=blue><FONT FACE=monospace><br>Conn.Open "Tree", "sa", ""<br>RS.Open "SELECT Tree.HID, Tree.ID, Tree.Name, InputType.Type, Tree.Val, Tree.Label, Tree.HParent, Tree.LParent FROM Tree INNER JOIN InputType ON Tree.Type = InputType.ID order by Tree.HID, Tree.ID",Conn, 0,1<br>If not RS.EOF then<br> RS.MoveFirst<br> AryData = RS.GetRows<br> RS.Close<br>end if<br>RS.Open "Select * from LanguageLabel",Conn, 0,1<br>If not RS.EOF then<br> RS.MoveFirst<br> LangData = RS.GetRows<br> RS.Close<br>end if<br>Set RS = nothing<br>Conn.Close<br>Set Conn = nothing<br><br>replacelang LangData, AryData<br> <br>' -- Starts the simple tree view --<br><br>showtreeat AryData, 0,0, False<br>Response.write "<form action=""FormatMulti.asp"" method=""Post"">" & vbcrlf<br>Response.Write vbtab & "<Table border=0 align=center Width=""80%"">" & vbcrlf<br>Response.Write vbtab & vbtab & "<TR><TD " & gTopColor & " align=center valign=middle colspan=2> <H1> " & LangLookup("Multi", "Report", "Print"

& " </H1> </TD></TR>" & vbcrlf<br>Response.Write vbtab & vbtab & "<TR>" & vbcrlf<br>Response.Write vbtab & vbtab & vbtab & "<TD " & gTableCellColor & " width=""50%"" valign=top><Table border=0 width=""100%"">" & vbcrlf & HTMLStr1 & vbcrlf & "</Table></TD>" & vbcrlf<br>Response.Write vbtab & vbtab & vbtab & "<TD " & gTableCellColor & " width=""50%"" valign=top><Table border=0 width=""100%"">" & vbcrlf & HTMLStr & vbcrlf & "</Table></TD>" & vbcrlf<br>Response.Write vbtab & vbtab & "</TR>" & vbcrlf<br>Response.Write vbtab & vbtab & "<TR><TD " & gBottomColor & " align=center valign=middle colspan=2><input type=""Submit""></TD></TR>" & vbcrlf<br>Response.Write vbtab & "</Table>" & vbcrlf<br>Response.Write "</form>" & vbcrlf<br><br>set AryData = nothing<br>Response.Flush<br>Response.write "</body>" & vbcrlf & "</html>"<br></font></font> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href=
</a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>