×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Did someone ask about editing per chacter entry

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

RE: Did someone ask about editing per chacter entry

(OP)
Mike ,I found this in some veryold code
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

(OP)
I would like to show u some code for Maskedit, but
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

I use this one a lot, I use the tag property for the filtering.
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

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.

Join Us             Close