>After treeview is loaded I would like to set the node from a value of database.
>
>I have tried thisform.oletreeview.Nodes(Thisform.txtcd_servico.Value).key = 'P'+LTRIM(STR(Thisform.txtcd_servico.Value)), but doesn't work.
I am not sure if I understand what are you trying to do, your code should work, providing that 'P'+LTRIM(STR(Thisform.txtcd_servico.Value)) is unique (there can be only one node with a given key), but it won't change the tree itself, you are going to still see the same representation of it, if you want to change the displayed text then the property to change is Text
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges