Solved

Calculate text from two text boxes into another text box

Posted on 2006-07-22
1
228 Views
Last Modified: 2010-04-17
I have two text boxes that  txtbox1 require the operator to enter a value, this value is the initial RAW weight then Txt BOX2 is the final weight after some gain, on TXTbox3 I want to give me a calculated percent value as the values are input on the TXTBOX1 and TXTBOX2 , but I need to get this gain value without any CLICK bottoms, as soon as the operator input the value on TXTBOX1 or TXTBOX2   I want to see percent values on TXTBOX3
0
Comment
Question by:teogos
1 Comment
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 250 total points
ID: 17160577
Which programming language are you using? After looking at your recently asked question I'll assume your using visual basic for now...

You can handle the Change event for textbox1, textbox2... in the event handling procedure you can update textbox3 with the calculation result depending on whats already in textbox1 and 2... small example to give you an idea:

Private Sub txtBox1_Change()
    If Trim(Me.txtBox1.Text) <> "" And IsNumeric(Me.txtBox1.Text) Then        
         If Trim(Me.txtBox2.Text) <> "" And IsNumeric(Me.txtBox2.Text) Then
            Me.txtBox3.Text = <Your calculation here>
        End If
    End If
End Sub

Private Sub txtBox2_Change()
    If Trim(Me.txtBox2.Text) <> "" And IsNumeric(Me.txtBox2.Text) Then        
         If Trim(Me.txtBox1.Text) <> "" And IsNumeric(Me.txtBox1.Text) Then
            Me.txtBox3.Text = <Your calculation here>
        End If
    End If
End Sub

This should change the value of txtBox3 as and when the values are typed into txtBox1 & 2
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

919 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

22 Experts available now in Live!

Get 1:1 Help Now