da_chocapic
Messages postés43Date d'inscriptionsamedi 8 octobre 2005StatutMembreDernière intervention27 juin 2006
-
16 juin 2006 à 15:04
jrivet
Messages postés7392Date d'inscriptionmercredi 23 avril 2003StatutMembreDernière intervention 6 avril 2012
-
16 juin 2006 à 15:48
Bonjour a tous,je cherche simplement a savoir comment forcer un utilisateur a mettre un entier dans une textbox,et non pas du text ou autre chose.
Cela doit etre qqchose du genre
if text1 <> integer then
" hop hop hop ! "
end if
jrivet
Messages postés7392Date d'inscriptionmercredi 23 avril 2003StatutMembreDernière intervention 6 avril 201260 16 juin 2006 à 15:23
Salut,
Ta feuille contient un textbox appelé Text1
Private Sub Text1_KeyPress(KeyAscii As Integer)
'Mise a part le suppr, le point et le backspace
If KeyAscii <> vbKeyBack And KeyAscii <> vbKeyDelete Then
If Not IsNumeric(Chr(KeyAscii)) Then KeyAscii = 0
End If
End Sub