Calculations on a parent form based on info in Child

  • Thread starter georgeka via AccessMonster.com
  • Start date
G

georgeka via AccessMonster.com

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... I was told to use the following
formulas
Count of Donations:
=dcount("DonationID", "Donations", "ContributorID = " & me.lngContributorID)

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


Where the me indicates 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?

I appreciate any assistance!!
 
C

Carl Rapson

If I understand your question correctly, 'lngContributorID' refers to the
ContributorID field on your main form. Replace 'lngContributorID' with your
field name from the Contributors table.

Carl Rapson
 

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