Jim Dettman
jimdettman at earthlink.net
Mon Jun 23 08:35:54 CDT 2003
Chris, The logic you refer to is typically used in BOM (Bill of Material) explosions. A straight SQL solution is difficult in that you need to know the number of levels before hand. I refer the VBA code approach, which allows for an unlimited number of levels. I have 2 SQL solutions; one by Joe Cleko (sp?) and one by a fellow expert on Experts Exchange with a different SQL approach, and my own VBA example. Although these don't deal specifically with employee's, the logic is the same. If you view the samples as the assembly being the supervisor, and the components as the employees that report to them. Drop me and e-mail off-list and I'll send them along. HTH, Jim Dettman President, Online Computer Services of WNY, Inc. (315) 699-3443 jimdettman at earthlink.net -----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