Sub Text1_Keypress(KeyAscii As Integer) If KeyAscii <> Asc("9") Then If KeyAscii <> 8 Then KeyAscii = 0 End If End If End Sub