B
Bernie Yaeger
I'm trying to control the textbox keypress event to deal with a "." such
that it disallows a second "." and no characters after 2 numbers beyond the
"." (thus a currency value). I have no problem with the numeric characters,
but I am using this to identify how many chars are after the ".", but it's
not working:
Dim pos As Integer
pos = InStr(1, ratevar1.Text, ".")
If pos <> 0 And ratevar1.Text.Length - pos = 2 Then
SendKeys.Send("{BACKSPACE}")
Exit Sub
End If
This hangs up and continually calls the keypress event. How can I simply
identify that the decimal point has 2 chars behind it and exit the sub
gracefully?
Thanks for any help.
Bernie Yaeger
that it disallows a second "." and no characters after 2 numbers beyond the
"." (thus a currency value). I have no problem with the numeric characters,
but I am using this to identify how many chars are after the ".", but it's
not working:
Dim pos As Integer
pos = InStr(1, ratevar1.Text, ".")
If pos <> 0 And ratevar1.Text.Length - pos = 2 Then
SendKeys.Send("{BACKSPACE}")
Exit Sub
End If
This hangs up and continually calls the keypress event. How can I simply
identify that the decimal point has 2 chars behind it and exit the sub
gracefully?
Thanks for any help.
Bernie Yaeger