My Assistant
![]() ![]() |
|
|
Sep 8 2005, 04:19 PM
Post
#1
|
|
|
New Member Posts: 1 |
I have a form that I am using as sort of a dashboard. The form is bound to a "client" table. For each client, I want to see the total dollar amount that the client has spent. Each client sale is listed by client ID on a sales transactions table. How do I get the sum of the amounts spent in the sales transactions table for each client ID to show on my form? What I think needs to happen is that for the current client showing on the form, it needs to calculate the total of the transactions on the sales transactions table for that client ID and return that total to the form control. Help.
|
|
|
|
Sep 8 2005, 04:43 PM
Post
#2
|
|
|
UtterAccess Enthusiast Posts: 73 From: Canada |
NZ(Dsum("[IndividualSpent]","[SalesTransactionTable]","ClientID=" & "[Forms]![frmDashboard]![clientID]"),0)
Replace: IndividualSpent - with the field for the sale value in your sales stransaction table SalesTransactionTable - with the name of your sales transaction table ClientID - with the name of the field containing the client id on your table [forms]![frmdashboard]![clientID] - with the similar path to the client ID field on your form. This should work, just don't forget the quotation marks. |
|
|
|
Sep 9 2005, 12:19 PM
Post
#3
|
|
|
UtterAccess Enthusiast Posts: 73 From: Canada |
QUOTE Thank you for answering my post yesterday. Would I put this in the Control Source of the text box I want it to dispay in? The expression you gave works if I use a client ID and delete the & "[Forms]![frmDashboard]![clientID] part. In other words, if I just use "ClientID=7". How would I get it to read the current clientID populating the rest of the form? Or should I build a subroutine to run from the On Current property of the form. If I do that, how do I bound the text box to that? Thanks for the assistance. Just a note, it's prefered if you post in the original post so that others can benefit from your experiences. Want you want to do is put this in the control source of the text box you want it to display in. and, leave in the & "[Forms]![frmDashboard]![clientID]" part, this is what picks out the value of the client ID and refrences the Dsum to it. It would help if you could post atleast the dashboard form so I can see exactly what you have named each control. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 03:31 PM |