"WJA" <WJ****@hotmail.com> wrote in
news:11**********************@g44g2000cwa.googlegr oups.com:
I'm looking at building an application that needs to display 4
levels of hierarchical data. Initially the obvious choice for
this would seem to be the treeview control. After searching
this newsgroup I've found that there is a lot of opinion that
says to stay away from the treeview if at all possible due to
lack of documentation and distribution problems. Added to
this, I've never used it before and don't need a new learning
curve at the moment.
Are there user friendly alternatives to the treeview using
native Access controls? For instance, a series of list boxes
or combo boxes. Without actually trying it, I think that this
could be made to work. I'm not sure just how user friendly it
would be though.
Has anyone implemented this type of alternative to the
treeview? I would be grateful to hear of any experiences or
opinions.
Thanks in advance.
Actually, you can simulate a treeview with a form in datasheet
view and some code to manipulate the form's filter.
You have to pre-compute the row number and store it in the
table, and also the level number.
table structure
ROW, LEVEL, text2display
--- ----- ------------
1 1 aaaa
2 2 bbbb
3 3 cccc
4 4 dddd
5 3 xxxx
6 2 yyyy
7 1 fsdf
8 2 sdfs
9 3
to expand a node, you get its row number, as rowfrom, the number
of the next row as rowto at the same or lower level and level +1
as newlevel and add a filter condition that adds
Where ((rownumber BETWEEN RowFrom AND RowTo -1) AND level =
newlevel).
String a bunch of these together with OR and you have a
treeview.
Example Where (([ROW] between 1 and 6) AND level <= 1) OR
(([ROW] between 2 and 5) AND level <= 2) OR (([ROW] between 3
and 4) AND level <= 4)
store each set of to, from and level in an array and you got a
good start.
--
Bob Quintal
PA is y I've altered my email address.