Results 1 to 3 of 3

Thread: decimal and backspace

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 13

    I am using the above and need to add backspace and decimal to the allowed characters. I'm at work and don'thave msdn to look it up...

    Help please...code...chr(ascii) what?

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Posts
    106
    text box called text1....

    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 8 Then Exit Sub ' backspace

    If KeyAscii = 46 Then
    If InStr(1, Text1.Text, ",") <> 0 Then ' only allow one decimal
    KeyAscii = 0
    Else
    Exit Sub ' decimal
    End If
    End If

    If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
    End Sub

  3. #3

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Thanks,
    Wayne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width