Equipment List In Tree View

  • Thread starter Russ via AccessMonster.com
  • Start date
R

Russ via AccessMonster.com

Ok, trying to make a form with a tree view of all equipment, not sure how to
set up tables as to get this view ..

example:
Equipment Main Categories = Plant Equipment
Equipment Sub-Categories1 = Cooling/Ventilation
Equipment Sub-Categories2 = A/C Units
Equipment Sub-Categories3 = Window Mounted
Equipment Sub-Categories3 = Main Unit

Should it be a main asset table like...
AssetID
Category1
Category2
Category3
or.....
AssetID
Category
WithSubCategory Detail Table 1
WithSubCategory Detail Table 2
WithSubCategory Detail Table 3

Any help with table set up and query type would be great...

Thanks
 
D

Dorian

A tree view does not care how you have your source data. However, you need a
routine to (a) load the tree from your table, and, (b) save the tree back to
the table.
Dealing with data in a tree view is not a trivial matter. Especially if you
want to allow adding, deleting and updating nodes.
When I did it, I kept my data in a two-column table:
ID
ParentID (points to ID)
That is all you need to describe a tree. Top level nodes have NULL ParentID.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
R

Russ via AccessMonster.com

Thanks, do you know of any good sites to get sample code and or direction on
how to program the treeview?
A tree view does not care how you have your source data. However, you need a
routine to (a) load the tree from your table, and, (b) save the tree back to
the table.
Dealing with data in a tree view is not a trivial matter. Especially if you
want to allow adding, deleting and updating nodes.
When I did it, I kept my data in a two-column table:
ID
ParentID (points to ID)
That is all you need to describe a tree. Top level nodes have NULL ParentID.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
Ok, trying to make a form with a tree view of all equipment, not sure how to
set up tables as to get this view ..
[quoted text clipped - 21 lines]
 
R

Rob Parker

Hi Russ,

The best example I've seen which illustrates the MS treeview control and its
capabilities is on Alex Dybenko's site. Have a look at
http://www.pointltd.com/Downloads/Details.asp?dlID=36

HTH,

Rob

Thanks, do you know of any good sites to get sample code and or
direction on how to program the treeview?
A tree view does not care how you have your source data. However,
you need a routine to (a) load the tree from your table, and, (b)
save the tree back to the table.
Dealing with data in a tree view is not a trivial matter. Especially
if you want to allow adding, deleting and updating nodes.
When I did it, I kept my data in a two-column table:
ID
ParentID (points to ID)
That is all you need to describe a tree. Top level nodes have NULL
ParentID. -- Dorian
"Give someone a fish and they eat for a day; teach someone to fish
and they eat for a lifetime".
Ok, trying to make a form with a tree view of all equipment, not
sure how to set up tables as to get this view ..
[quoted text clipped - 21 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top