Calculations on a parent form based on info in Child

G

georgeka

Bear with me, I am very new to access...
I have a contributor table and a donations table. I also have a form for each.
On the contributors form I have displayed a child form generated from the
donation table which shows the donations that contributor has made. I would
like to have a few fields on the parent which totals info listed in the child.
For example: Count of donations made, Total value of those donations, and
Based on the amount the individual has donated I would like Access to assign
a category. Friend, Supporter, patron....you get the idea...

Help! I greatly appreciate any assitance I can get.
 
D

Damian S

Hi georgeka,

Use unbound textboxes on your main form using dcount() to get the counts you
require and dsum() to get the sums. Check out Access help for specifics, but
generally it would be like this:

Count of Donations:
=dcount("DonationID", "Donations", "ContributorID = " & me.lngContributorID)

Sum of Donations:
=dsum("DonationAmount", "Donations", "ContributorID = " & me.lngContributorID)

Working out what type of person they are:
=iif(dcount("DonationID", "Donations", "ContributorID = " &
me.lngContributorID) > 5, "MegaDonator", "Normal")

Hope this helps.

Damian.
 
G

georgeka via AccessMonster.com

Damian,

Thank you! I understand the formula till you get to the "& me.lng" then I
am lost. what does that mean? I searched web, access help etc, for somthing
similar and came up with nothing.
I appreciate your help.



Damian said:
Hi georgeka,

Use unbound textboxes on your main form using dcount() to get the counts you
require and dsum() to get the sums. Check out Access help for specifics, but
generally it would be like this:

Count of Donations:
=dcount("DonationID", "Donations", "ContributorID = " & me.lngContributorID)

Sum of Donations:
=dsum("DonationAmount", "Donations", "ContributorID = " & me.lngContributorID)

Working out what type of person they are:
=iif(dcount("DonationID", "Donations", "ContributorID = " &
me.lngContributorID) > 5, "MegaDonator", "Normal")

Hope this helps.

Damian.
Bear with me, I am very new to access...
I have a contributor table and a donations table. I also have a form for each.
[quoted text clipped - 6 lines]
Help! I greatly appreciate any assitance I can get.
 
G

georgeka via AccessMonster.com

PLEASE HELP!!!

I researched the formula Damian gave me and found that "me" just indicated
the current form. I tried replacing that with the actual form name because I
read that "me" won't work in the control source of calculated controls. This
would be the new formula

=DCount("DonationID","Donations","ContributorID = " & [Forms!Donations1!
Contributor ID].lngContributorID)

I am still perplexed on what the lng would do, or how to make this work.

Can anyone please assist?
Damian,

Thank you! I understand the formula till you get to the "& me.lng" then I
am lost. what does that mean? I searched web, access help etc, for somthing
similar and came up with nothing.
I appreciate your help.
Hi georgeka,
[quoted text clipped - 21 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top