Looping and create table query (1 Viewer)

B

boatguy

Guest
If you need for me to further clarify this question, please don't hesitate to ask.

I have a dilemma. I've developed a web site for a Multi-Level Marketing company where new members can sign-up and in doing so enter the number of their sponsor into the form. I am writing the data to an Access table and in the table I have a sponsorID field (sponsorid being just that, the number of their sponsor).
I need to calculate the downline of all members to four levels and write to a new table the MemberID and a total count of his/her downline.
It's like this:
Bob signs up 10 people and all ten enter Bob's ID into the sponsorid field.
Those 10 people each sign up 10, those 10 sign up ten and those ten sign up ten...for a grand total of 10000 people in Bobs downline. Each new member enters the sponsorid of the sponsor directly above them and not the id of the originator.
Example:
Parent = Bob - ID is 1
First level - All enter 1 into sponsorid
Second level - enter appropriate id of first level sponsor
Third level - enter appropriate id of second level sponsor
Fourth level - enter appropriate id of third level sponsor

How do I loop through the sponsorid field to get that calculation so that it can be written to the new totals table?

Am I clear enough?

I would really appreciate your help.
 

Users who are viewing this thread

Top Bottom