Access 2007-2019 Access 2000-2003 Access Seminars TechHelp Support Tips & Tricks Access Forum Course Index Topic Glossary Insider Circle

 Home   News   Courses   Tips   Templates   Forums   Help   Order   Contact   Logon More... What's New? Tips & Tricks Access Index Access Tips Excel Index Excel Tips Waiting List

 NEW:    dismiss
 Glossary New Entries Added Almost Daily! Click here to get on our Mailing List
 Access    Excel    Word    Windows    HTML

# DSum

## Using the DSUM Function

In this tutorial you will learn how to use the DSUM Function.

Take an example Table of Customers.

CustomerT
CustomerIDFirstNameLastNamePhoneCustomerSinceCreditLimitDaysGraceIsActive
1RichardRost716555777701/01/201210011True
2JoeSmith716555343401/03/19905005True
3SuzanJones562436514602/01/199815002False
4AlanWatson419389121217/05/2012503True
5AnnaPicore71323647905/05/200510204True
6RonaldSimms780746546804/04/1992502True
7DonaldBarker416441555501/03/19982505True
8BennySperduti716726726206/04/199916007False
9PeteSmith564559777704/04/20005003False
10BarbraPeters829282728831/12/2005501True
11JoeJones549546546601/06/20045003True
14PezzDispo26/09/201204True
16BobSmith04/10/201209True

For this example we wish to total or return the Sum (Σ) of CreditLimit but only if the Customer is Active.

The DSUM function returns the sum from a specified set of records (or domain).

=DSUM(Field, Domain, Criteria)

The answer being \$3,421.00.

Query

The results using a Query would be

```	SELECT Sum(CreditLimit) AS SumOfCreditLimit FROM CustomerT GROUP BY IsActive HAVING IsActive=True;
```

FORM

In a Form you could set the Default Value of a Textbox to

```	=DSUM("CreditLimit", "CustomerT", "IsActive=TRUE")
```
VBA

In a Form add a TEXTBOX control and rename it "txtDSum", then you could add the following in the Load Event.

```	Private Sub Form_Load()
txtDSum = DSum("CreditLimit", "CustomerT", "IsActive=TRUE")
End Sub
```

Courses Tip

See this FREE Tip on DSUM.

Search

You can find more about this by searching the website.

Click here to sign up for more FREE tips

 You may want to read these articles from the 599CD News:
 5/30/2020 Two New Access Handbooks 5/30/2020 Access Tip Sleep Timer 5/18/2020 Access Record Source Property 5/3/2020 Access Replace Function 5/1/2020 Microsoft Access Tutorials 4/24/2020 Access Discontinued? 4/21/2020 Date Time Clock Picker Template 4/20/2020 Access Backup Record Before Edited 4/17/2020 ZIP Code Lookup Template 4/16/2020 Access Round Nearest 10

Learn

 Access index Excel index Word index Windows index PowerPoint index Photoshop index Visual Basic index ASP index Seminars More...
Customers

Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info

Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search The Site
Waiting List
Production Schedule
Collapse Menus
Help

Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About

Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order

Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact

Live Chat
General Info
Support Policy
Contact Form
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey