[AccessD] Select a node in a treeview

Max Wanadoo max.wanadoo at gmail.com
Wed Oct 7 12:40:51 CDT 2009


Slowly making progress.

I have now built the tree ok but when I try to position back on a node I get
an error.

This first bit is ok.
  Dim tvw As TreeView, nod As Node, strNod As String
  Set tvw = Me.TreeView1.Object
  Set nod = tvw.Nodes("Lv3:1") ' hard code the key
  nod.Selected = True ' select it

as does this bit.

  strNod = nod.FullPath ' get the name (path) of the selected node.
  Debug.Print strNod ' works fine
  MsgBox strNod ' works fine
  
  'the above works just fine but when  I try to reverse it I get an error
35601Element not found
  
Try to position on a key using the key's value
  Set nod = tvw.Nodes(strNod)
  nod.Selected = True

ERROR

	I am looking for some way to get it to position on a key from the
key's  value.

Any help appreciated.


Max


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: 07 October 2009 15:52
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Select a node in a treeview

Treeview.Nodes("SomeKey") value is going to return a single node that
matches the key.  Also, in Access (Sorry, forgot this part), you need to use
the treeview's object:

Dim tvw As TreeView
Set tvw = Me.tvwSkills.Object

Drew
/www.databaseadvisors.com




More information about the AccessD mailing list