By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,913 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,913 IT Pros & Developers. It's quick & easy.

How to show sum total of specific field description in a text box in form

P: 1
Suppose I have a table of three fields ID; Seller Name & Daily Sale in Rupees.

There are many entries in a day. At the end of the week I want to see sum total of specific sellers' sales in a TextBox on a Form.
1 Week Ago #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 8,652
  1. First, let's make a couple of assumptions:
    1. Table Name: tblSales
    2. Field Names:
      • [ID] - Primary Key {AUTONUMBER/Primary Key}
      • [SName] - Salesperson Name {TEXT}
      • [Sale] - Sale for the Day {CURRENCY} - in US Dollars
    3. Form Name: irrelevant
    4. TextBox Name for Salesperson - [txtName]
    5. Unbound TextBox on Form - txtSales
    6. Current Conversion Rate: 1 US Dollar ==> 61.06 rupees
    7. Control Source of txtSales:
      Expand|Select|Wrap|Line Numbers
      1. =61.06*Nz(DSum("[Sale]","tblSales","[SName]='" & [txtName] & "'"),0) & " rupees"
  2. This will generate the Total Sales in rupees for the Current Salesperson on your Form.
  3. Criteria can be expanded for Date Range, etc.
1 Week Ago #2

Expert Mod 15k+
P: 31,530
Hi ADezii.

Were exchanging Rupees for Dollars or vice versa required then I doubt a hard-coded value for the rate would be considered to be adequate going forward. However, I suspect, as all the data is entered, stored and displayed in Rupees, there would be no need for conversion in there.

Obviously this leaves the required solution to be even simpler than you've already posted :-)
1 Week Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.