Private Sub Text1_KeyPress(KeyAscii As Integer) If Not (IsNumeric(Chr(KeyAscii)) Or KeyAscii = 8) Then KeyAscii = 0 End Sub