View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
tkraju via OfficeKB.com tkraju via OfficeKB.com is offline
external usenet poster
 
Posts: 109
Default code for conditional validation to textboxes

Thank You Rick,
you are right.Your testing logic is really hundred percent right.Thanks You
so much....

Rick Rothstein (MVP - VB) wrote:
I am probably missing something in your question, but why can't you simply
test if the Text values of the two TextBoxes are equal or not (doesn't
matter if the entry is numeric or not... if there's something in TextBox1,
then it has to equal TextBox2... period)...

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
With TextBox2
If Len(.Text) 0 And .Text < TextBox1.Text Then
MsgBox "Invalid entry! Entry must match archival value."
Cancel = True
.SelStart = 0
.SelLength = Len(.Text)
End If
End With
End Sub

Rick

Mr.Rick,
I have a some modification of my question,can you modify the code a bit

[quoted text clipped - 54 lines]
or
corrects the entry by putting only numeric values.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200806/1