Hi good people.
I am have an unusual problem. I am trying to compare the values in two textboxes and the less than compare is not working for some strange reason. I created a test application to see if it might be something in my larger application, but it does the same thing when I create a form with two textboxes and a command button. The following is the test code:
Private Sub CommandButton1_Click()
If TextBox1.Value < TextBox2.Value Then
MsgBox "Re-enter TB1"
Exit Sub
End If
MsgBox "Greater than"
End Sub
It's pretty strainght-forward and simple, but it doesn't seem to work.
The test number I used was 1000.21 for textBox1 and 500 for Textbox2. The msgbox Reenter comes up when I enter these values. The Greater Than should be coming up though.
Am I doing something wrong? Any suggestions? DAVE
I am have an unusual problem. I am trying to compare the values in two textboxes and the less than compare is not working for some strange reason. I created a test application to see if it might be something in my larger application, but it does the same thing when I create a form with two textboxes and a command button. The following is the test code:
Private Sub CommandButton1_Click()
If TextBox1.Value < TextBox2.Value Then
MsgBox "Re-enter TB1"
Exit Sub
End If
MsgBox "Greater than"
End Sub
It's pretty strainght-forward and simple, but it doesn't seem to work.
The test number I used was 1000.21 for textBox1 and 500 for Textbox2. The msgbox Reenter comes up when I enter these values. The Greater Than should be coming up though.
Am I doing something wrong? Any suggestions? DAVE