>How to tell whether a node is exist?
>I try
>VARTYPE(THISFORM.oleControl1.Nodes('AR3'))
>
>but give me error message :
>OLE IDispatch exception code 0 from Nodes: Element not found...
>
>
>TIA and merry x'mas.
The other suggestions are good
One way is to check for the existence of the node's data record in a table - if it is in the table - it must be in the tree view.
I have never used the PEMSTATUS (it looks cool) - but I have used the object test with both VARTYPE and TYPE and found it was more reliable to test the nodes key property for a "C" data type.
IF TYPE('myform.myTV.Nodes([AR3]).key')==[C]
You can also test to see if the selected node is a child node:
IF TYPE('myform.myTV.Nodes([AR3]).Parent.key')==[C]
Imagination is more important than knowledge