Developerman2000
Programmer
I am trying to validate textbox entry into a basebase program so the user can only enter Numeric Values. I has the IsNumeric validation is work ok as below.
Dim checkKeyPR As String
Dim checkEntry As String
checkKeyPR = txtPrice.Text
If txtPrice.Text = "" Then Exit Sub
If (Not IsNumeric(checkKeyPR)) Then
checkEntry = Left(checkKeyPR, Len(checkKeyPR) - 1)
MsgBox "You can only enter a Numeric Value!"
txtPrice.Text = checkEntry
End If
SendKeys "{end}"
But When you enter a NonNumeric value into the middle of a Entry it Deletes the incorrect entry but also deletes all numeric values to the RIGHT of the TextBox!
Any Ideas?
Dim checkKeyPR As String
Dim checkEntry As String
checkKeyPR = txtPrice.Text
If txtPrice.Text = "" Then Exit Sub
If (Not IsNumeric(checkKeyPR)) Then
checkEntry = Left(checkKeyPR, Len(checkKeyPR) - 1)
MsgBox "You can only enter a Numeric Value!"
txtPrice.Text = checkEntry
End If
SendKeys "{end}"
But When you enter a NonNumeric value into the middle of a Entry it Deletes the incorrect entry but also deletes all numeric values to the RIGHT of the TextBox!
Any Ideas?