+ Reply to Thread
Results 1 to 8 of 8

Sum in TextBox

  1. #1
    Registered User
    Join Date
    11-04-2008
    Location
    Brazil
    Posts
    31

    Sum in TextBox

    Hi,

    I need your help.
    I can't do sum into the Texbox. For example, I have three TextBox

    TextBox1 with a Value
    TextBox2 with a Value
    TexBox3 Sum TextBox1 + TextBox2

    So, I can't do this..

    Follow attached the draft file.

    Thanks in advance.
    Regards, Capone.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-16-2008
    Posts
    32
    Please Login or Register  to view this content.
    There you go
    Last edited by shg; 12-16-2008 at 01:06 PM. Reason: deleted spurious quote

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483
    Why not
    Please Login or Register  to view this content.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You are trying to summ the totals with the afterupdate event of each textbox. You will get an error if one of the textboxes is empty or does not contain a number.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by davesexcel View Post
    Why not
    Please Login or Register  to view this content.
    Dave the entry in the textboxes is by default a String so you need to use CDbl or CCur change the strings to values. Your code will just concatenate the entries, not add them up
    Last edited by royUK; 12-16-2008 at 12:09 PM.

  6. #6
    Registered User
    Join Date
    11-04-2008
    Location
    Brazil
    Posts
    31

    ...

    All,


    Your Code:

    Please Login or Register  to view this content.

    This code not run and de sum TextBox1 (when I input USD 2,50) + TextBox2 (when I input USD 3,00) produce in TextBox3 USD 575,00



    somebody has another ideia please?

    Thanks in advance!

    Pietro.

  7. #7
    Registered User
    Join Date
    06-16-2008
    Posts
    32
    It works juts fine for me.

    Use . instead or , or change the formatting I guess.
    Last edited by shg; 12-16-2008 at 01:05 PM. Reason: deleted spurious quote

  8. #8
    Registered User
    Join Date
    11-04-2008
    Location
    Brazil
    Posts
    31
    For me no...independent if you use "." or ","

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1