This is what i assume reading your thread:
This are your fields
- AgentNo (the person's identification number in the agency)
- AgentName (self-explanatory)
- Parent (the AgentNo of the agent who directly manages them)
- Depth (an indicator of how many levels into the hierarchy they are)
Now I guess this is wht you want
AgentName Depth
RuralGuy 5
Pbaldy 4
Drake 3
so you want the name in this order
.....RuralGuy
....Pbaldy
...Drake
I have used dots you want spaces
I have a table with Fields P_Name and hierarchy
I have used the following Functions:
To add spaces before the names:
NameInOrder: Space([hierarchy]) & [P_Name]
To add . or any other characters:
NameInOrder1: String([hierarchy],".") & [P_Name]
I have used the Hierarchy field to provide the number of . or Spaces to be put before the names.
See the screen shot attached to see the effect.
Mark the thread solved if this solves your problem.