Did someone ask about editing per chacter entry
Did someone ask about editing per chacter entry
(OP)
I have some code that edits EACH keystroke for specific types.. tusconpapa
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS Contact USThanks. We have received your request and will respond promptly. Come Join Us!Are you a
Computer / IT professional? Join Tek-Tips Forums!
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting Guidelines |
Did someone ask about editing per chacter entry
|
Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.
Here's Why Members Love Tek-Tips Forums:
Register now while it's still free!
Already a member? Close this window and log in.
RE: Did someone ask about editing per chacter entry
Just post it here Tusconpapa, lots of people "lurk" (read everything but don't post" who will find it useful.
Mike
---
Mike Lacey
Mike_Lacey@Cargill.Com
Cargill's Corporate Web Site
RE: Did someone ask about editing per chacter entry
Private Sub Amount_Change()
Dim strvalid As String
strvalid = "0123456789."
If keyascii > 26 Then
If InStr(strvalid, Chr(keyascii)) = 0 Then
keyascii = 0
End If
End If
AccessKeys = vbKeyReturn
End Sub
RE: Did someone ask about editing per chacter entry
my copy is a very early BATA release with a random
number error generator so u always get a different
error number even if u follow the same steps. DON'T
U just love the maskedit. ! of course it's undocumemted, why change now ! T.
RE: Did someone ask about editing per chacter entry
The Val("12,2") is to find out what the decimal point is comma or a period intead of using an API to find the locale.
Function filtext(KeyAscii As Integer, tag As String) As Integer
Dim txt As String
Dim nut As String
Dim datf As String
Dim telf As String
datf = "1234567890/-"
If Val("12,2") = 12 Then
nut = "1234567890,-"
Else
nut = "1234567890.-"
End If
telf = "1234567890/-() "
txt = "abcdefghijklmnopqrstuvwxyz ABCDEFGHI'JKLMNOPQRSTUVWXYZÑñáéíóú"
filtext = KeyAscii
If tag = "a" Then
If InStr(1, txt, Chr(KeyAscii)) > 0 Then filtext = KeyAscii Else filtext = 0
ElseIf tag = "n" Then
If InStr(1, nut, Chr(KeyAscii)) > 0 Then filtext = KeyAscii Else filtext = 0
ElseIf tag = "t" Then
If InStr(1, telf, Chr(KeyAscii)) > 0 Then filtext = KeyAscii Else filtext = 0
ElseIf tag = "d" Then
If InStr(1, datf, Chr(KeyAscii)) > 0 Then filtext = KeyAscii Else filtext = 0
ElseIf Left(tag, 1) = "s" Then
If InStr(1, tag, Chr(KeyAscii)) > 0 Then filtext = KeyAscii Else filtext = 0
End If
If KeyAscii = 8 Or KeyAscii = 9 Then filtext = KeyAscii
End Function