R
Rod
I am inputting phone numbers using voice recognition. VR sometimes places a
"-" in a number when it thinks it is a phone number (which it is), but I just
want the raw number, such as 5556666 instead of 555-6666. It sometimes hears
sounds and places words in the field as well, such as 555and6666. is there a
smarter way to do this:
Private Sub INPUT_NUMBER_Exit(Cancel As Integer)
'Numbers only
If Not IsNull(INPUT_NUMBER) Then
INPUT_NUMBER = Replace(INPUT_NUMBER, "-", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, " ", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "a", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "b", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "c", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "d", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "e", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "f", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "g", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "h", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "i", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "j", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "k", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "l", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "m", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "n", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "o", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "p", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "q", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "r", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "s", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "t", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "u", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "v", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "w", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "x", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "y", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "z", "")
End If
End Sub
When inputting, I do not want the input to be interrupted, just cleanedup
before updating or at least cleanedup upon exiting. I tried "BeforeUpdate"
but received an error saying it did not like this done BeforeUpdate or
validation rule was stopping it (I have no validation rule).
Thanks.
"-" in a number when it thinks it is a phone number (which it is), but I just
want the raw number, such as 5556666 instead of 555-6666. It sometimes hears
sounds and places words in the field as well, such as 555and6666. is there a
smarter way to do this:
Private Sub INPUT_NUMBER_Exit(Cancel As Integer)
'Numbers only
If Not IsNull(INPUT_NUMBER) Then
INPUT_NUMBER = Replace(INPUT_NUMBER, "-", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, " ", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "a", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "b", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "c", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "d", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "e", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "f", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "g", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "h", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "i", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "j", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "k", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "l", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "m", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "n", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "o", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "p", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "q", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "r", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "s", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "t", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "u", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "v", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "w", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "x", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "y", "")
INPUT_NUMBER = Replace(INPUT_NUMBER, "z", "")
End If
End Sub
When inputting, I do not want the input to be interrupted, just cleanedup
before updating or at least cleanedup upon exiting. I tried "BeforeUpdate"
but received an error saying it did not like this done BeforeUpdate or
validation rule was stopping it (I have no validation rule).
Thanks.