Total on a Form

mjwillyone

Registered User.
Local time
Today, 16:12
Joined
Aug 3, 2004
Messages
27
Friends,

I have a table that contains pledges to various causes. Here is a sample of the fields I want to use and the type of info in each field:

PldgCode AmtPerGift
24 10.00
32 15.00
24 10.00

What I want to be able to do is put the number 24 in a field on the form, then on another field the value of $20 would show up (the sum of the two pledges in the amount of $10 each to project number 24.) Is there a way I can do this?? I wouldn't mind using a query that, say, is started when I click a button it looks at the field where I put the pledge code and then puts the $20 amount in a field on the form. I do want to use the $20 amount in another calculation so this process should actually save the sum of the pledges to a field.

Any help you can give would be most appreciated.
 
You should be able to use the DSum() function to get what you want. VBA Help has a pretty good description on how to properly use the function.
 
You can use the pldgCode controls after update event to refresh the totals pledges control. use the below expression for the total pledges control

=DSum("AmtPerGift","[TableName]","PldgCode='" & forms![FormName]![PledgeNumberControlName] & "'')
 

Users who are viewing this thread

Back
Top Bottom