On Nov 15, 3:29 am, "perfectclick...@gmail.com"
<perfectclick...@gmail.comwrote:
I'm a beginner ofMSAccess, I need adequate knowledge on how to
programme. I have a challenge in my office to write a pragramme that
will calculate a compensation for all our distributors. This is a
network marketing company that has so many distributors, and almost
all the distributors are introduced by one distributo or other.
For example:
Mr. A introduce Mr. B,
Mr. B introduce Mr. C,
And Mr. C introduce Mr. D.
Mr. A has succeeded in having one (one) direct Downline and 2 (two)
indirect downlines.
The Challenge I have is the Hierarchy, calculating the compensation
and reporting how much are we paying all the distributors in a
particular month.
Thanks!
Just found this challenge!
You could start with this 2 table solution:
1. Table of people (tPeople)
Fields: ID (autonumber/primarykey), Name
2. Table of Introductions (tIntros)
Fields: ID (autonum/primarykey), IntroducerID (Long integer
pointing to tPeople's ID), IntroduceeID (same), Date, ynDirect (Yes/
No), Amt
Note: Right in the table design, you can have the drop-down list
of People appear for the 2 foreign keys.
This approach doesn't have the smarts to automatically set the
ynDirect to Yes or No based on examining other records but at least
you can enter it and report on it.
Maybe after a few years of practice you can do the code for that :)
Many ways of calculating the compensation.
You could have an update query fill in the Amt column with
IIf(ynDirect, <RateforYes>, <RateforNo>)
You can have the report calculate the amount in the same way without
using any Amt field (However when it comes to money, it should be set
right away so as to avoid problems with changing rates or rules.)
Or you could make a look up table with the two rates that is related
to tIntros thru ynDirect.
David, Access Application Developer
PS:
I love Lyle's philosophical answer, too.