P
Phil Hellmuth
I've got a table with two relevant columns: Code and ParentCode. 'Code'
is a child of the parent. A ParentCode value will also exist as the
child code in another row in the table. For the highest row in the
tree, the Code and ParentCode will have the same value. There's a
limitless number of iterations in the hierarchy of parent/child codes.
For example, we may have something like this:
Code ParentCode
---- ----------
0000 0000
1000 0000
1500 1000
2000 1000
2500 1000
3000 2000
I need to present the data, either via query or creating a new table via
VBA, so that it's sorted by the hierarchy, for as many levels as it may
go. Using the above data as an example, I want to present the data in
the following way:
Code ParentCode
---- ----------
0000 0000
1000 0000
1500 1000
2000 1000
3000 2000
2500 1000
3000/2000 moves up a notch, because I want to keep next sequentially
because of the 2000 value.
As I said, the number of branches in the tree are limitless, which
really complicates the matter. Is there a simple way to do this?
Thanks in advance.
is a child of the parent. A ParentCode value will also exist as the
child code in another row in the table. For the highest row in the
tree, the Code and ParentCode will have the same value. There's a
limitless number of iterations in the hierarchy of parent/child codes.
For example, we may have something like this:
Code ParentCode
---- ----------
0000 0000
1000 0000
1500 1000
2000 1000
2500 1000
3000 2000
I need to present the data, either via query or creating a new table via
VBA, so that it's sorted by the hierarchy, for as many levels as it may
go. Using the above data as an example, I want to present the data in
the following way:
Code ParentCode
---- ----------
0000 0000
1000 0000
1500 1000
2000 1000
3000 2000
2500 1000
3000/2000 moves up a notch, because I want to keep next sequentially
because of the 2000 value.
As I said, the number of branches in the tree are limitless, which
really complicates the matter. Is there a simple way to do this?
Thanks in advance.