RE: Summing fields in subform
- From: Cheese_whiz <Cheesewhiz@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 9 Dec 2008 03:23:01 -0800
Hi CRBI,
You could use DSum:
=DSum("Amt", "Contributions", "MemberID = " & Me.txtMemberID)
Assuming:
"Amt" is the field in your subform's recordsource (table or query) where
donation amounts are stored.
"Contributions" is the name of your table or query that holds contribution
records
"MemberID" is the primary key from your main form's recordset (table or
query), and it's a number type field (could/most likely is an autonumber)
"txtMemberID" is the main form control that is bound to the memberId field
in your main form's recordsource
HTH,
CW
"CRBI" wrote:
I have a members database with a table for member info and a table for their.
contribution amounts. I have created a form based on the member table with a
subform from the contributions table. Since a single member can make several
contributions within one year, I want a field next to the subform to sum the
total contributions that particular member has made to date. I can't seem to
get the syntax right to make that work. I created an unbound text box and
used the following syntax:
=sum(Forms![Contributions Subform]Amt!)
I built this using expressions.
- References:
- Summing fields in subform
- From: CRBI
- Summing fields in subform
- Prev by Date: Re: Primary Key format
- Next by Date: Re: Signature tablet
- Previous by thread: Summing fields in subform
- Next by thread: RE: Summing fields in subform
- Index(es):
Relevant Pages
|