Je cherche une astuce SVP

Résolu
sipilto Messages postés 7 Date d'inscription lundi 5 février 2007 Statut Membre Dernière intervention 20 novembre 2009 - 11 janv. 2009 à 13:52
sipilto Messages postés 7 Date d'inscription lundi 5 février 2007 Statut Membre Dernière intervention 20 novembre 2009 - 11 janv. 2009 à 15:14
bonjour,

je cherche un astuce pour effacer tt les textbox lorsque on click sur un bouton et je veu une method apar :

text1="": text2="": text3="": ....

et merci d'avance ;)

4 réponses

skyla Messages postés 60 Date d'inscription samedi 17 juin 2006 Statut Membre Dernière intervention 19 octobre 2009
11 janv. 2009 à 14:17
Salut,
Petite procédure qui peut t'aider
Sub ViderMesChamps(ByRef Parent As Form)
    Dim Ctrl As Object
    For Each Ctrl In Parent
        If TypeOf Ctrl Is TextBox Then Ctrl.Text = vbNullString
    Next Ctrl
    Set Ctrl = Nothing


end sub


Utilisation:


ViderMesChamps
Me
'Parent:la feuille ou tu souhaite effacer les textbox
'Textbox pour préciser qu'il s'agit de zone de texte,donc peut être remplacer par tout type de contrôle
a+







<sup>
[mailto:Sk@yL


S


]
</sup>



<sub>


</sub>
3
PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
11 janv. 2009 à 14:10
salut,



<hr />
'    EFFACER TOUS LES TEXTBOX D'UN USERFORM
'    http://www.codyx.org/snippet_effacer-tous-textbox-userform_304.aspx#981
'    Posté par [ PCPT ] le 15/02/2007
<hr />




Sub 
ClearTextBoxes(
ByRef 
Parent 
As 
Form)

    Dim Ctrl As Object
    For Each Ctrl In Parent
        If TypeOf Ctrl Is TextBox Then Ctrl.Text = vbNullString
    Next



Ctrl



    Set Ctrl = Nothing
End Sub








<hr size="2" width="100%" />
Prenez un instant pour répondre à [sujet-SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp 
0
skyla Messages postés 60 Date d'inscription samedi 17 juin 2006 Statut Membre Dernière intervention 19 octobre 2009
11 janv. 2009 à 14:20
Oups!!! dévancer pendant que je répondais,en plus la même réponse lol





<sup>
[mailto:Sk@yL


S


]
</sup>



<sub>


</sub>
0
sipilto Messages postés 7 Date d'inscription lundi 5 février 2007 Statut Membre Dernière intervention 20 novembre 2009
11 janv. 2009 à 15:14
 merci SKYLA et aussi un merci a PCPT
0
Rejoignez-nous