Family tree (1 Viewer)

Falcon88

Registered User.
Local time
Today, 23:38
Joined
Nov 4, 2014
Messages
297
hiii all dears

i search for best way to build a family tree database , the best way that i found as in
http://allenbrowne.com/ser-06.html
is by using one table only , i have design a table " tblPersonsData" with 4 fields :

-PersonID : Primary key
-FatherID
-PersonName
-PersonBirhDate.


the FatherID field stores No. of person that is father of this person ( taken from same table )

if i want to get first 3 names of a person , i compose a query using tblPersonsData 3 copies with aliases g1, g2, g3
with relation as g1.PersonID>>>g2.FatherID and g2.PersonID>>>g3.FatherID .

My Question is : how to build a form to get all father and grandfathers of this person ( not the first 3 names only )
 

Ranman256

Well-known member
Local time
Today, 16:38
Joined
Apr 9, 2015
Messages
4,339
I use:
tPerson table
PersonID
FirstN
LastN
ParentsID



tParents table:
ParentsID
FatherID
MotherID
DateWed
DateDivorced
etc

(or just use 2 generic terms instead of Mother/Father)
 

Falcon88

Registered User.
Local time
Today, 23:38
Joined
Nov 4, 2014
Messages
297
I use:
tPerson table
PersonID
FirstN
LastN
ParentsID



tParents table:
ParentsID
FatherID
MotherID
DateWed
DateDivorced
etc

(or just use 2 generic terms instead of Mother/Father)


it is not important to store mothers data .

if there more than 10 generations in table how to get all the names of grandfathers for a person ?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:38
Joined
May 21, 2018
Messages
8,463
Take a look at this thread. I do multiple pedigrees (family tree).
https://www.access-programmers.co.u...30&highlight=coefficient+of+inbreeding&page=2

If you want to go a max of X generations, you can build an unbound form and populate it as demonstrated. If you want to go an unlimited amount of generations you need to use a treeview which the code demonstrates.

FYI, I would not do the Allen Browne approach.
 

Falcon88

Registered User.
Local time
Today, 23:38
Joined
Nov 4, 2014
Messages
297
i want to go to unlimited generations .

please help how to use code with my db.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 16:38
Joined
May 21, 2018
Messages
8,463
How proficient of a coder are you? The code is not trivial. I will see if I can pull out the important stuff from the example to make generic for people.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:38
Joined
Feb 28, 2001
Messages
27,001
Having done something similar to this about two years ago, I can tell you that a pure Access solution will have to be done mostly with VBA because queries don't work more than one layer (or one generation) at a time. The way I approached it was with two main tables.

I have a Person table where everyone has a unique ID plus their personal info. Things like name, birth date, death date (which can be empty), and a couple of other things for identification purposes. But not EVERYTHING about them, just a few key items.

I had a Relations table which listed two IDs representing two people, plus a code for the relationship between them. I only allowed Mother, Father, Son, Daughter, and Sibling. I had two entries in the Relations table for any pair of people because, of course, relationships are not single-person things. Yes, everything was all relative. Or relatives.

So for example, I had Richard (Sr) - father of - Richard (Jr) and Richard (Jr) - son of - Richard (Sr). Did it that way because I wanted not only to go backwards in time to see ancestors of person X, but also I wanted to go forward in time to list descendants of a particular person (a list that included ME).

There was a third table, Attributes, that was sparse - i.e. variable amounts of data per person, for address (which had dates on it), place of birth, place of death, military service, pace of burial, degrees, etc., but these items were not necessary for the tree builder. They were part of something else entirely.

Before you ask, I got all of my information from Ancestery.COM in the form of a GEDCOM file, which I would not wish on my worst enemy. I cobbled together something kind of by the seat of my pants.

I had to parse out the GEDCOM file by reading it as text because it doesn't directly import well into a table. It contains three different record formats for three different types of records. You can EASILY get lost in following the links around to match up their person ID to something that Access will tolerate. Let's not even THINK about what THEY use as a family ID. I spent more time on deciphering the damned GEDCOM format than I did on the tree generation.

I can give hints but my code is kind of difficult and I'm not happy with it because the recursion sometimes goes crazy when we get those "dotted lines" that occur in a family. For instance, we have a case in our tree where a woman's legal father (married to her mother at the time) and biological father and adopted father ('cause the legal father found out about the biological father and split, and then the mother died and the biological father was too immature to take on a child...) EACH supplied her with half-siblings who grew up in three different families. Talk about a DOOZIE to record.

To make this kind of database, you need to be proficient in:

non-binary tree recursive programming techniques
database normalization

Were you planning on entering your own data or were you planning on getting it through a GEDCOM or other geneology data file? If from some external-source file, add to the list of necessary skills

text parsing

THEN there is the problem of how you will want it represented for output. I ended up using Excel but turns out there is a "catch" to this. I was only able to make three generations fit at one time on an 8 1/2 x 11 page and still have the names and supplemental info still be readable. I tried using Excel's "SmartArt" feature which allows for organizational trees, but that turns out to be a nightmare controlling it from VBA. SmartArt can't handle a dumb programmer like me. (Or maybe that is vice versa...)

I don't wish to make it sound like it can't be done because I did something sort of like what you were asking about. And using that tool plus GEDCOM data, I can take my family tree back to mid-1400s Sussex, England, which ain't half bad. I can take my wife's family back to the Acadian Diaspora when France sold Canada to England and the Acadians came to south Louisiana in response. It happened in 1736, and is the Cajun equivalent to "coming to America on the Mayflower."

I'm with MajP on this: It is NOT a project for the faint of heart and it DOES involve advanced programming techniques such as recursion.
 

Users who are viewing this thread

Top Bottom