>Thaks for helping - I am attempt understand.
>
>I will take step at a time
>
>If I index on the table to show only parents
>and only wanted to show one node for each parent
>
>All Accounts
> :
> ____ Parent 1
> ____ Parent 2
>
>thisform.treeview.Nodes.Add(,4,ALLTRIM(code1),ALLTRIM(name))
>
>Error reads: OLE Idispatch exception code 0 from Nodes Invalid Key
>
>Leo
If you want to show all parents (these with empty(code2) and EMPTY(Code3)) they must be subordinate to All Accounts node
thisform.treeview.Nodes.Add("KeyOfAllAccountsNode",4,ALLTRIM(code1),ALLTRIM(name),0) to get
All Accounts
:
____ Parent 1
____ Parent 2
But if you want all Parents to make their own MAIN node in the treeview then it must be
thisform.treeview.Nodes.Add(,1,ALLTRIM(code1),ALLTRIM(name),0) to get
All Accounts
Parent 1
Parent 2
...
thisform.treeview.Nodes.Add("PARENTCODE HERE",4,"CODE FOR NODE HERE",ALLTRIM(name),0)
If the node doesn't have Parent (i.e. All Accounts Node) it must be:
thisform.treeview.Nodes.Add(,1,"MAIN NODE KEY HERE",ALLTRIM(name),0)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.