Sum a field in a form

C

CRBI

This is a little quirky. I have a form for member data that includes a
subform for the member's contribution amounts. (I asked about this before but
I don't think I was clear enough to get the correct response. My fault.). The
subform is from a Member's Contributions table which is, of course, tied to
the Member's table via Member ID. The subform is in the form footer (of
course) where I also have another subform for the events the members have
participated in. (That subform is not a worry). I need to be able to sum the
total amount of contributions to date that a member has made. I have placed a
text box between the two subforms but i can't seem to figure out the correct
code or syntax to make it display this. Do I need to SUM on the subform
itself and then somehow link to a text box on the Member's form footer or is
there a code I can use?

Here are the specifics:
Table-Members
Table-Members Contributions (inc ID, Amt, Date, Most Current)

Any help is appreciated! Thanks!
 
R

RonaldoOneNil

Assuming the Member ID is numeric
Set the controlsource of your textbox to
=DSum("[Amt]","Members Contributions","[inc ID] = " & Me.[Member ID])

If the Member ID is text then delimit with single quotes
=DSum("[Amt]","Members Contributions","[inc ID] = '" & Me.[Member ID] & "'")
 

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