Solved

Totaling Values in Custom Fields

Posted on 2003-12-01
3
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Accepted Solution

by:
Dexstar earned 125 total points
ID: 9851913
@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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

733 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