I'm not sure what you are asking about, but if you don't want numbers and you allow user to type any two letters then use this:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If IsNumeric(Chr(KeyAscii)) Then
KeyAscii = 0
End If
End Sub
Also set TextBox's MaxLength property to 2
~~~~~~~~~~~
Or if you know what two letters you want the user to enter (for example if you want them to type C for Credit and D for Debit) and you want the user to enter only one letter on a time then use this:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (Chr(KeyAscii)) <> ["Enter Your First Character"] or (Chr(KeyAscii)) <> _
["Enter Your Second Character"] Then
KeyAscii = 0
End If
End Sub
And set MaxLength Property to 1
~~~~~~~~~~~~~~~~~~
------------------
Visual Basic Programmer (at least I want to be one)
------------------
PolComSoft
You will hear a lot about it.
[This message has been edited by QWERTY (edited 12-04-1999).]