Max Wanadoo
max.wanadoo at gmail.com
Wed Oct 7 16:00:13 CDT 2009
Aha! Yes, got it. I was extracting the Titles that appeared on the treeview and then trying to backtrack from that. If I had of extracted the key, then I could have pulled the key components. Thanks Drew. Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: 07 October 2009 21:45 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Select a node in a treeview Hmmmm, I think you missed the point of my first post on this. The point was that you should design your key BASED on the data from the recordset. That way, when you are in the midst of a recordset, you can find the key (and if you are at a node, you can find the record in the recordset)..... Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Wednesday, October 07, 2009 3:16 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Select a node in a treeview Um, yes. But how do I get the key when all I know is the info from the recordset,ie I know what the top level record is and the middle level record and the bottom level record. EG. Dept, manager, employee. Do I have to traverse the tree looking for a match at each level, extracting and building the key as I go? Max -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: 07 October 2009 20:42 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Select a node in a treeview Don't use full path, use 'key'. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo Sent: Wednesday, October 07, 2009 12:41 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Select a node in a treeview 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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com