May 30 2006, 06:07 AM
My database has a table which tracks donations made by supporters of the charity I work for. I have a supporters table with a one to many relationship to a donations table, and I'm trying to work out how to display a "total donations to date" control in my Supporters form, which will sum all of the donations made for that supporter in the donations subform.
Would love some pointers as to where to start! I'm sure it's very simple, but I can't quite wrap my brain around it, no matter how much reading I do.
May 30 2006, 06:14 AM
Use an unbound textbox and use an expression like this as the control source:
=DSum("DonationValue", "TheTableName", "Supporterid = '" & forms!thisformname!txtSupporterid & "'")
This assumes that the control which holds the supporterid is called txtsupporterid and that supporterid (or whatever your field is called) is text.
If supporterid is number then use : ...."Supporterid = " & forms!thisformname!txtSupporterid )
Obviously you need to use your own table and field names.
May 30 2006, 06:20 AM
Have look this Post
May 30 2006, 06:52 AM
Thanks Sameed, just what I needed! Can't beleive I didn't think of it, you're a star!
May 30 2006, 06:54 AM
Glad to help you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here