Mike and Doris Manning
mikedorism at ntelos.net
Mon Jun 23 07:43:08 CDT 2003
Picture a spiral staircase in your mind. You are standing on the top step and way down at the bottom is that teeny tiny bottom step that you can barely see. As you walk down the steps, the bottom steps slowly come into focus... First Step: Create a query of all the people who have no one above them. Take a Step: As you add each name to the tree, you will call a function (passing in their EmployeeID) that selects all the people who report directly to them (MasterID = passed in EmployeeID). Continue to Step: As you add each of these names to the tree, you will recursively call that same function to select all the people who report directly to them. The DBA website has a treeview tutorial submitted by Arthur Fuller if you need further help... http://www.databaseadvisors.com/downloads.htm Doris Manning Database Administrator Hargrove Inc. www.hargroveinc.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Christopher Hawkins Sent: Sunday, June 22, 2003 5:25 PM To: accessd at databaseadvisors.com Subject: [AccessD] Populate a treeview via Self-SELECT? OK. Here's what I've got: 1) Access2K database containing an Employee table. 2) The Employee table includes the fields SSN, FirstName, LastName, and ManagerID. 3) My client wants to see a treeview representing the reporting hierarchy of the employees in table Employee. We don't have a fixed number of reporting levels. In theory, the organizational layout could go from having every employee manage one other employee to having only one manager in the entire company to whom everyone else reports. I'm having a real mental block regarding how to populate the treeview. Anyone care to offer a fresh perspective? I've probably been staring at this problem too long to see new alternatives on my own. -Christopher- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com