Solved

Parent / Child Relationship - Viewing and editing - MS Access

Posted on 2009-05-07
9
741 Views
Last Modified: 2012-05-06
I am working on the design of a database enhancement that will incorporate parent/child relationships.  I am looking to have the ability to have an ongoing string of Parent, Child, Grandchild, etc. I have two tables:

PEOPLE:  PersonID, Person
LINK: ParentID, ChildID

I have a query that links the parents to the children.  I've filled in some data below and also attached it as a screen.  As you can see.  Dave is a parent of Amy and Carrie.  Amy is a parent of Dylan and Colin, therefore Dave is a grandparent of Colin.  

One of the main things I am looking for is a way to display the relationships for the user to view.  If this could be done on a form, it would be preferable.  I have attached a screenshot of the "visual view" of the relationships that I would ideally like to see.  I have looked into the "treeview" ActiveX component, but could not get anywhere with that.  

Any assistance or ideas you could provide would be greatly appreciated.
Parent  | Child

Dave    | Amy

Dave    | Carrie

Amy     | Dylan

Amy     | Colin

Open in new window

Parent-Child-Query.jpg
Visual-View.jpg
0
Comment
Question by:cdmac2
9 Comments
 
LVL 10

Expert Comment

by:LukeChung-FMS
ID: 24326391
In Access, you can use subdatasheets in your tables to go down one level, but I don't think it's recursive.
You'll need to use the Treeview control to do this but it'll require a bit of VBA coding to load it up.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 24326493
see if this link helps
How To Use the ADO SHAPE Command
http://support.microsoft.com/kb/189657

0
 
LVL 1

Author Comment

by:cdmac2
ID: 24327350
Thanks capricorn1... that ADO SHAPE command may work, but I cannot figure it out from the article (it's a little too technical for me).  Could you show me how to use the SHAPE command using my example data?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 1

Author Comment

by:cdmac2
ID: 24340229
Just following up... Any suggestions??
0
 
LVL 5

Accepted Solution

by:
noetymology earned 500 total points
ID: 24392580
Since you want to display relationship of your data to your user, treeview control suits this requirement. Please find attached a sample database created using KB article http://support.microsoft.com/kb/209891 which is a simpler method. You will have to change the field names in the table/code. Open the form and expand Fuller by double clicking it. Hope this helps.
Parent-Child-.mdb
0
 
LVL 1

Author Comment

by:cdmac2
ID: 24470237
That did it... thx noetymology!!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now