Solved

Calculate sum of currency textbox values II

Posted on 2006-06-25
2
716 Views
Last Modified: 2012-06-27
HI Experts,

I need help on the code to calculate the sum of textbox values.

Sample of amounts entered in TextBoxes:
TextBoxA = $7890.00
TextBoxB = $7860.00
TextBoxC = $10.00
TextBoxD = $0.00

TextBoxE = Total of amounts

All TextBox Null values are $0.00
Properties are set to Currency.

Windows Application
Visual Studio 2005
SQL Server 2005




0
Comment
Question by:dave_sky
[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
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 16979147
How about something like:

        Try
            Dim total As Double = 0.0
            total += Double.Parse(TextBox1.Text.Substring(1))
            total += Double.Parse(TextBox2.Text.Substring(1))
            total += Double.Parse(TextBox3.Text.Substring(1))
            total += Double.Parse(TextBox4.Text.Substring(1))
            TextBox6.Text = total.ToString("C")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
0
 

Author Comment

by:dave_sky
ID: 16979240
That was easy!

Many thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

734 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