Drew Wutka
DWUTKA at Marlow.com
Mon Aug 31 17:04:25 CDT 2009
LOL, yes, actually you can't 'bind' a treeview to a recordset. So it is an unbound control. There is a difference between a node in a treeview and a record in a table. With a record in a table, all of the OTHER fields are readily available if need be, where as a node doesn't contain a 'record', on the displayed text, picture (if used) the Key and the Tag. So making the Key more meaningful makes them easier to work with. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby Sent: Monday, August 31, 2009 4:57 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Drew - Help on TreeView Please >I will use a 'natural' key of sorts, which makes the node key more meaningful (and useful in later code). OMG don't tell me you are going unbound at the same time! ;) John W. Colby www.ColbyConsulting.com Drew Wutka wrote: > No problem. I just sent you the fix off list. Correcting this > particular error showed two more issues which I fixed too. > > Ironically, the issue wasn't technically a treeview issue. However it > did relate to how I personally use treeviews (so my example used this > method). The nodes of a treeview have to have a unique key. So if you > have ten thousand nodes, each node 'key' must have unique to the other > 9,999 nodes. With a table, you would use an Autonumber, however, with a > treeview branching out, I will use a 'natural' key of sorts, which makes > the node key more meaningful (and useful in later code). > > For example, let's take names: > > 1 Bob > 2 Dave > 3 Tina > 4 Drew > 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.