Results 1 to 6 of 6

Thread: [RESOLVED] Calculations in Textboxes

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    102

    Resolved [RESOLVED] Calculations in Textboxes

    Salute to all the Guru,
    Lets say,
    I have 2 Textboxes presentstock.text and consumed.text

    i want to minus consumed.text (value) from presentstock.text

    i wrote

    VB Code:
    1. presentstock.text = val(consumed.text) - val(presentstock.text)

    but its not working

    Need Help;

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Calculations in Textboxes

    Quote Originally Posted by Plucky
    Salute to all the Guru,
    Lets say,
    I have 2 Textboxes presentstock.text and consumed.text

    i want to minus consumed.text (value) from presentstock.text

    i wrote

    VB Code:
    1. presentstock.text = val(consumed.text) - val(presentstock.text)

    but its not working

    Need Help;
    What is not working about it?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    102

    Re: Calculations in Textboxes

    Mr. Hack thanx for attention.
    The value appears in the presentstock.text with (-) minus sign..
    help, plz

  4. #4
    New Member
    Join Date
    Dec 2005
    Posts
    1

    Re: Calculations in Textboxes

    hey first of all you shoul make another text box for that
    3 Textboxes presentstock.text, consumed.text and result

    result = (consumed.text - presentstock.text)

  5. #5
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Calculations in Textboxes

    shouldn't it be just the opposite of what you are doing, like this:
    VB Code:
    1. presentstock.text = val(presentstock.text) - val(consumed.text)

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    102

    Re: Calculations in Textboxes

    Hi Good People,
    Thanx its working now..

Posting Permissions

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



Click Here to Expand Forum to Full Width