>SAMPLE JKT001 Lesley >SAMPLE JKT002 Mark >TECHNICAL JKT564 Brian >>
>SAMPLE (2) > JKT001 Lesley > JKT002 Mark >TECHNICAL (1) > JKT564 Brian >>Can anybody help me in hwo I would do this.
Create Cursor queryresults (f1 c(10), f2 c(10), f3 c(10)) Insert Into queryresults Values ('SAMPLE','JKT001','Lesley') Insert Into queryresults Values ('SAMPLE','JKT002','Mark') Insert Into queryresults Values ('TECHNICAL','JKT564','Brian') * Define some constants. #Define tvwFirst 0 #Define tvwLast 1 #Define tvwNext 2 #Define tvwPrevious 3 #Define tvwChild 4 Public oForm oForm = Createobject('myForm') oForm.Show Define Class myForm As Form Height = 300 Width = 500 Add Object myTree As OleControl With ; Height = 300, ; Width = 500, ; OleClass = 'MSComCtlLib.TreeCtrl' Procedure filltree Select f1,Cnt(*) ; From queryresults ; group By 1 ; Into Array parentnodes With This.myTree.nodes For ix=1 To _Tally .Add(,tvwFirst,Trim(parentnodes[m.ix,1]),; Textmerge('<<Trim(parentnodes[m.ix,1])>> - (<<parentnodes[m.ix,2]>>)')) Endfor Select queryresults Scan .Add(Trim(f1), tvwChild, ; Padl(Recno(),5,'_'), Trim(f2-(' '+f3))) Endscan Endwith Endproc Procedure Init This.myTree.linestyle =1 This.filltree() Endproc EnddefineCetin