Exécuter macro après validation d'un textbox

cs_LT Messages postés 1 Date d'inscription mardi 8 juin 2004 Statut Membre Dernière intervention 8 juin 2004 - 8 juin 2004 à 15:25
cs_yannickt Messages postés 64 Date d'inscription lundi 25 août 2003 Statut Membre Dernière intervention 22 novembre 2011 - 12 juil. 2004 à 04:42
Bonjour,
Comment faire pour :
- valider une saisie dans un textbox par la touche entrée ?
- déclencher ensuite l'exécution d'une macro.
Merci.

1 réponse

cs_yannickt Messages postés 64 Date d'inscription lundi 25 août 2003 Statut Membre Dernière intervention 22 novembre 2011
12 juil. 2004 à 04:42
Bonjour, pour faire cela, en vb6, tu double-clique sur ton contrôle textbox, tu est dans l'action "CHANGE", dans le code, tu sélectionne l'action "KEYPRESS", tu as (EX: Private Sub Text1_KeyPress(KeyAscii As Integer)), le code ascii de "enter" est 13, donc tu écrit comme code:

Private Sub Text1_KeyPress(KeyAscii As Integer)
if keyascii = "13" then
'CE QUE TU VEUX FAIRE À LA PRESSION DE ENTER
end if
end sub
0
Rejoignez-nous