try this following code, this code didn't allowed you to input any special character just numbers and letters:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 65 To 90, 48 To 57, 8 ' A-Z, 0-9 and backspace
'Let these key codes pass through
Case 97 To 122, 8 'a-z and backspace
'Let these key codes pass through
Case Else
'All others get trapped
KeyAscii = 0 ' set ascii 0 to trap others input
End Select
End Sub