Private Sub Text1_KeyPress(KeyAscii As Integer)If KeyAscii < Asc("0") Or KeyAscii > Asc("9") ThenKeyAscii = 0BeepEnd IfEnd Sub