Solved

Totaling Values in Custom Fields

Posted on 2003-12-01
3
171 Views
Last Modified: 2010-04-08
Using code, I am having a challenge totaling numbers from 5 different fields and displaying the total in a totals field. When I the following for example:
txtotal = txtNum1 + txtnum2 + txtNum3 + txtNum4 + txtNum5
Let's say that each field is hold the numbers 1 2 3 4 5 respectfully.
The result is 12345. It is concatinating the numbers instead of summing them up.
any ideas on how to do this in code.
0
Comment
Question by:Lorenzog0917
3 Comments
 
LVL 19

Accepted Solution

by:
Dexstar earned 125 total points
Comment Utility
@Lorenzog0917:

> txtotal = txtNum1 + txtnum2 + txtNum3 + txtNum4 + txtNum5

Try this:
     txTotal = CLng(txtNum1) + CLng(txtNum2) + CLng(txtNum3) + CLng(txtNum4) + CLng(txtNum5)

Hope That Helps,
Dex*
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
If you don't know how to downgrade, my instructions below should be helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now