Queries to Make Org Chart Files

erinwithane

New member
Local time
Today, 15:36
Joined
Apr 12, 2013
Messages
4
I’m trying to create a process in Access that will a give me a file I can use to build org charts in Visio.

I have a table which contains all of our employees and all of their info. The table is called “EmployeeList”
Employee ID
Employee Name
Employee Job Code
Employee Job Title
Employee Pay Grade
Employee FTE Status
Date of Hire
Dept Number
Department Name
Employment Type
Location
Supervisor ID
Supervisor Name
Supervisor Job Title

First I would like to create a Form that will allow the user to select a Supervisor from a combo box list. (cbo_supervisor)-This I know how to do

After the supervisor has been selected, the user would then select how many levels down from that supervisor they want for their org chart. I’m envisioning command buttons with select querys (Or a macro containing a series of queries) assigned to them, returning the results that can be imported as an excel file into Visio. Here are my Command button options:

cmd_level1 -1 Level-Supervisor & Direct Reports
cmd_level2 -2 Levels-Supervisor, Direct Reports, & their subordinates
cmd_level3 -3 Levels-Supervisor, Direct Reports & their subordinates, and the subordinates of the supervisors direct reports subordinates
cmd_level4 -4 Levels- Supervisor, Direct Reports & their subordinates, the subordinates of the supervisors direct reports subordinates, and any subordinates of those subordinates
cmd_all -All Levels-Supervisor and every employee in their chain of command

Here are my questions:
How do I design these queries?

In other words, If I Select Supervisor “Obama, Barack” from the combo box, then click the button that says “3 Levels”-how should I build a query that: looks at the supervisor I selected in the combo box, queries the “EmployeeList” table for all the employees that are 3 levels down in that supervisors chain of command, and then display those results?

Specifically, what do I need to have in my query so that it knows to return results only for the number of levels down I have selected in the selected supervisors chain of command?

So, for example-If the user selects “Obama, Barack” and “all Levels” the query would return Barack Obama, everybody in the entire executive branch, which would be every record in my table. If the user selects “Obama, Barack” and “1 Level” the query returns Barack Obama and the records from my table which contain his cabinet members (direct reports only). Does this make any sense?

Thank you

I’m using Access 2007.
 
Google Access hierarchy query
 
Last edited:

Users who are viewing this thread

Back
Top Bottom