Saisie dans DbGrid

Résolu
tiopan Messages postés 9 Date d'inscription vendredi 5 novembre 2004 Statut Membre Dernière intervention 10 novembre 2004 - 8 nov. 2004 à 14:46
cboulas Messages postés 2641 Date d'inscription mercredi 2 juin 2004 Statut Membre Dernière intervention 8 janvier 2014 - 8 nov. 2004 à 19:29
bonjour,

j'aimerais savoir comment limiter la saisie dans un controle DBGrid à du numerique??

J'ai essayé ceci mais ça ne fonctionne pas :
Private Sub DBGrid_rate_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode < 96 Or KeyCode > 105) And (KeyCode < 48 Or KeyCode > 57) Then
KeyCode = 0
End If
End Sub

2 réponses

cboulas Messages postés 2641 Date d'inscription mercredi 2 juin 2004 Statut Membre Dernière intervention 8 janvier 2014 16
8 nov. 2004 à 19:29
oups correction

If (Keyascii < 48 and Keyascii > 57) and keyascii<>8 and keyascii <>13 Then
Keyascii=0
End If


Chris...
Web : Firstruner - eMail : [mailto:support@firstruner.com Support]
3
cboulas Messages postés 2641 Date d'inscription mercredi 2 juin 2004 Statut Membre Dernière intervention 8 janvier 2014 16
8 nov. 2004 à 19:27
Met plutôt ceci dans un KeyPress

If (Keyascii < 48 and KeyCode > 57) and keyascii<>8 and keyascii <>13 Then
Keyascii=0
End If


Chris...
Web : Firstruner - eMail : [mailto:support@firstruner.com Support]
0
Rejoignez-nous