Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flexible treeview in Access

Status
Not open for further replies.

marcf

IS-IT--Management
Sep 9, 2002
2
BE
Hi All,

I have a little question for all of you Access experts.

I would like to have a treeview in Access (XP), linked to a database table.

The table has the following columns:

Table name: TREECONTENTS
Columns:
ID: Text (KEY)
Parent: Text
Caption: Text.

Each node in the treeview has corresponds to a line in the dB.
- The ID column is the identification (unique, can be automatically generated).
- The Parent field is ... the ID value of the parent node. For nodes in the root of the treeview, this value is empty.
- The Caption field is the text that is shown in the treeview in the form.

Ideally, I'm trying to create this form (or component, or whatever), including functions to add, delete, update nodes in the treeview ... but this is for me (Access freshman) a tough nut to crack...

I'm sure that this is a "classical" piece of code, and that it is highly reusable ...

Thanks to help me out !

Cheers,

Marc.
 
I'm not quite sure what you're looking for here. Do you want to write a hierarchical tree display of some sort from scratch, or are you trying to use the TreeView control that comes with Microsoft Windows Common Controls?

Either way, you're talking about quite a few lines of code to accomplish an editable tree view of your data. This is not a "little" question. If you are trying to use the TreeView control from Microsoft, please refer to the online help (COMCTL2.HLP) for descriptions and examples of the TreeView control, TreeView constants, Node objects, the Nodes collection, and the use of ImageList controls with a TreeView.

If you are trying to write your own hierarchical display of your data, then you'll need to supply a better description of what you want things to look like, and be aware that the best anyone can do to help you in this limited interactive space is to provide you with code fragments for specific portions of your project.
 
Check this thread183-300414 there are several links to possible solutions. It may require a redesign of the table to use something like Joe Celko's set solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top