Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie textbox question

Status
Not open for further replies.

RocAFella2007

Technical User
Mar 21, 2007
45
GB
Hi, was hoping somebody could help me out please.

I have two textboxes and one button, the value in textbox 2 should equal to or be less than the value in textbox1 when the button is selected. What would be the best way of doing this?

Thanks

so far I have

If textbox2.text =< textbox1.text then messagebox.show("Incorrect Value")

However its wrong, any help or suggestions?
 
That means textbox2 can't have a value larger than textbox1

Code:
        If CInt(TextBox2.Text) > CInt(TextBox1.Text) Then
            MessageBox.Show("Incorrect value")
        End If

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
This?

Code:
        Try
            If CInt(TextBox2.Text) > CInt(TextBox1.Text) Then
                MessageBox.Show("Incorrect value")
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error")
        End Try

________________________________________________________
Zameer Abdulla
Help to find Missing people
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top