Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2014
    Posts
    2

    Obtain hierarchy reports (direct and Indirect)

    I was wondering if there was a way to obtain all individuals that report to a particular person (directly or indirectly) through a query. A sample of the table is below:

    tbl_Hierarchy
    Enumber FName Mngr_Enumber
    E111 John E000
    E222 Mary E111
    E333 Paul E111
    E444 Sarah E999
    E555 Sam E333
    E666 Tom E111
    E777 Karen E111
    E888 Jim E666
    E999 Deb E666



    For example I would like to see everyone who reports through Tom(E666). The result should yield:
    E888 Jim E111
    E999 Deb E666
    E444 Sarah E999

    Any help is appreciated. Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    What about Jim?

    I expect this sort of search (recursive?) would require complicated VBA code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jun 2014
    Posts
    2
    Sorry I corrected my example. Jim should be part of the output.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Still don't think the posted example is correctly reflecting the data but is moot point. I don't have code to offer. I still think it will be very complicated. But I could be wrong.

    Bing: Access VBA hierarchy search

    Review: http://bytes.com/topic/access/answer...ierarchy-query
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating Hierarchy
    By Just_Some_Guy in forum Access
    Replies: 17
    Last Post: 07-24-2013, 07:06 AM
  2. Replies: 4
    Last Post: 01-05-2013, 02:43 AM
  3. Using a hierarchy table
    By younggunnaz69 in forum Queries
    Replies: 3
    Last Post: 07-18-2012, 10:11 PM
  4. Hierarchy summing
    By dskysmine in forum Queries
    Replies: 17
    Last Post: 06-19-2012, 04:08 AM
  5. product hierarchy
    By Lata in forum Access
    Replies: 13
    Last Post: 08-03-2011, 02:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums