• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 342
  • Last Modified:

Insert Alphabets

how to insert alphabets A-Z and a-z only ??

0
ANGmoh
Asked:
ANGmoh
  • 2
1 Solution
 
ayufansCommented:
insert into where ?? please be more specific.
0
 
ayufansCommented:
this example is inserting the text into a textbox :

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii < 65 Or KeyAscii > 122 Then
        KeyAscii = 0
    End If
End Sub

Hope this is what you wanted.

Good Luck
0
 
DocMCommented:
Hi,
To accept A-Z or a-z only:

Private Sub Text1_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii

        Case 8
            'Backspace accepted

        Case Asc("A") To Asc("Z")

        Case Asc("a") To Asc("z")

        Case Else
            'character not accepted
            KeyAscii = 0

    End Select

End Sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now