reference "parent" description in hierarchical data table

GBalcom

Much to learn!
Local time
Yesterday, 19:24
Joined
Jun 7, 2012
Messages
462
I used to be able to do this...about 2 years ago. It's amazing what you forget when you don't use the skills....

I have a table I'm trying to query information out of. Key fields are below:

  • RecNo (Key)
  • ParentRecNo
  • Description

I need to have a "record" in the query show both the description of itself, as well as it's parent. This is quick and dirty; I was hoping to use Dlookup directly in the query design. If there is no other way, I suppose I could create a temp table and look through the recordset in VBA and dump them into the temp table, but like I said; quick and dirty was the hope here, it's for my own use, and the tables aren't large 50-100 records is what I'll be pulling out when I use this.
 
You bring the table into the query twice, linking them from RecNo in one instance to ParentRecNo in the other.

If you come up with less records then you expect, then you need to make it a LEFT JOIN from the instance acting as the child.
 

Users who are viewing this thread

Back
Top Bottom