Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unbound Form - sum of field in table 1

Status
Not open for further replies.

fredka

Technical User
Jul 25, 2006
114
US
I have an unbound form that I use to run reports. On that form, I have a field named financefilemembers. In this field I want to hold the total number of "members" from a table named tblfinancefile.

I thought I could just put this in the open even of the form:

Me!financefilemembers.controsource = "SELECT Sum(FinanceFile.MEMBERS) AS SumOfMEMBERS FROM FinanceFile;"

However, that is not working.

Can someone point me in the right direction.

Thanks!!!!

Fred
 
If you want to use controlsource, then you'd need one of the Domain Aggragetes - if I remember the syntax right (check it in the help file);

[tt]=DSum("Members","FinanceFile")[/tt]

You say count, but show sum, check out the other Domain Aggregates too, DCount, DMax...

Roy-Vidar
 
Thanks so much for the help!!! I am not sure why I did not think that would work since I use dlookup all the time.

Thanks again, I appreciate it!!!! Here is what I ended up with:

Me.financefilemembers.Value = DSum("[Members]", "FinanceFile")

Fred
 
total number of "members" from a table named tblfinancefile
Me!financefilemembers.Value = DCount("Members", "FinanceFile")


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top