Ken,
I'm pretty sure this is an acknowledged bug using FOR EACH to iterate the treeview nodes. The other forloop you posted is the best workaround.
>Actually - we traced it to something that HAS to be a bug - namely a "for each loop"
>When treeview form is instatiated oTree.object correctly references the treeview object.
>Then we called a method that did a
for each loNode in oTree.Nodes
>do something
>endfor
after running that - oTree.object references the first node object! We fixed it by simply changing to
for i = 1 to oTree.Nodes.Count
>loNode = oTree.Nodes(i)
>do something
>endfor