I have tried all your suggestions but for some reason it does not work, this is what I am using. but I get a run-time error 438
Object doesn't support this property or method
'Node Level 3
Set rs = db.OpenRecordset("Nod1", dbOpenDynaset)
Do Until rs.EOF
Me!axtreeview.Nodes.Add rs!Nod.Value, tvwChild, rs!Nod1, rs!Nod1
Me.axtreeview.Node.EnsureVisible
rs.MoveNext
Loop
rs.Close
'Node Level 3
Dim nodNew As Node
Set rs = db.OpenRecordset("Nod1", dbOpenDynaset)
Do Until rs.EOF
Set nodNew = axtreeview.Nodes.Add rs!Nod.Value, tvwChild, rs!Nod1, rs!Nod1
nodNew.Expanded = True
rs.MoveNext
Loop
rs.Close
G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
Nice Job LittleSmudge you have gone from treeview student to teacher in one thread.
What I should have explained in more detail and will hopely clear it up for you at51178 is that each node is a collection of the treeviews nodes. So to set a nodes property you need refer to that node to set its property.
Me.axtreeview.Nodes(22).EnsureVisible would work
but not
Me.axtreeview.Node.EnsureVisible
the examples posted by LittleSmudge and Eric above are the proper way to load the treeview so you can track the current node
I personally don't like to expand all the nodes so using the ensurevisible will expand the particular node I want and scroll to it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.