RE: Summing fields in subform

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




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.
.



Relevant Pages

  • Only print cells with value Part 2
    ... I have a membership list that lists the church contributions made each week ... I want to print out a separate form for each member that has contributed ... ' Clear form sheet ... ' use cell as a filter criteria on detail sheet ...
    (microsoft.public.excel.programming)
  • Re: Query on Two Tables
    ... the reports that are generated from this query. ... retrieve contributions for the year for each contributor from the receipts ... FROM tblContributorInfo as C LEFT JOIN QContributions as Q ... You can choose to limit the returned fields by populating the select list with ...
    (microsoft.public.access.queries)
  • Re: Query on Two Tables
    ... I've tried adding a third query and joining ... doesn't give me the sum of contributions for that specific month anymore. ... FROM tblContributorInfo as C LEFT JOIN QContributions as Q ... You can choose to limit the returned fields by populating the select list with ...
    (microsoft.public.access.queries)
  • Re: Merge-Hookoms Concatenate Child Records
    ... FROM Contributors INNER JOIN Contributions ... You could then use a crosstab query to ... TRANSFORM First(qryContributions.[Contribution Amount]) ... > concatenate are of different types. ...
    (microsoft.public.access.queries)
  • Re: Query on Two Tables
    ... If you need more detail on the contribution, you can use a left join and a subquery on the contributions table. ... If you will supply some detail on the field names in the contributions table I can help you construct a query. ... If the names contain spaces or other characters then you will need to use two queries - a saved query to get the contribution information for the time period. ...
    (microsoft.public.access.queries)