CREATE TABLE tree (node N(2),child n(2), detail c(50)) INSERT INTO tree (node, child, detail) VALUES (1 ,0,"Root") INSERT INTO tree (node, child, detail) VALUES (2 ,1,"PAIDUP CAPITAL") INSERT INTO tree (node, child, detail) VALUES (3 ,2,"Eric den Doop") INSERT INTO tree (node, child, detail) VALUES (4 ,2,"Cetin Basoz") INSERT INTO tree (node, child, detail) VALUES (5 ,1,"DIRECTORS ACCOUNTS") INSERT INTO tree (node, child, detail) VALUES (6 ,5,"Sergy") INSERT INTO tree (node, child, detail) VALUES (7 ,5,"Borislav Borissov") INSERT INTO tree (node, child, detail) VALUES (8 ,1,"RESERVES") INSERT INTO tree (node, child, detail) VALUES (9 ,8,"Profit & Loss b/f") INSERT INTO tree (node, child, detail) VALUES (10,8,"Profit & Loss last year") INDEX ON STR(child,5)+STR(node,5) TAG tree thisform.LockScreen = .t. o = ThisForm.oleTree SELECT tree GO TOP SCAN IF tree.child = 0 oNode = o.nodes.add(,1,ALLTRIM(STR(tree.node))+"_",ALLTRIM(tree.detail),,) oNode.ForeColor = RGB(128,0,128) thisform.oleTree.SelectedItem = oNode ELSE oNode = o.nodes.add(ALLTRIM(STR(tree.child))+"_",4,ALLTRIM(STR(tree.node))+"_", ALLTRIM(tree.detail),,) ENDIF IF tree.child # 0 oNode.ForeColor = RGB(0,0,255) ENDIF oNode.Expanded = .t. ENDSCAN thisform.LockScreen = .f. USE>Dear Experts
>CREATE TABLE tree (node N(2),child n(2), detail c(50)) >INSERT INTO tree (node, child, detail) VALUES (1,0,"PAIDUP CAPITAL") >INSERT INTO tree (node, child, detail) VALUES (1,1,"Eric den Doop") >INSERT INTO tree (node, child, detail) VALUES (1,2,"Cetin Basoz") >INSERT INTO tree (node, child, detail) VALUES (2,0,"DIRECTORS ACCOUNTS") >INSERT INTO tree (node, child, detail) VALUES (2,1,"Sergy") >INSERT INTO tree (node, child, detail) VALUES (2,2,"Borislav Borissov") >INSERT INTO tree (node, child, detail) VALUES (3,0,"RESERVES") >INSERT INTO tree (node, child, detail) VALUES (3,1,"Profit & Loss b/f") >INSERT INTO tree (node, child, detail) VALUES (3,2,"Profit & Loss last year") >>