Código PHP:
Private Sub Text1_KeyPress(KeyAscii As Integer)
GCaracter = Chr(KeyAscii)
MsgBox GCaracter
If Not (GCaracter = Chr(8) Or GCaracter = Chr(13)) Then
If GCaracter < Chr(48) Or GCaracter > Chr(57) Then
KeyAscii = 0
Beep
End If
End If
End Sub