Faire des recherches dans la liste "MSFlexGrid1"

accent19811 Messages postés 98 Date d'inscription   Statut Membre Dernière intervention   -  
yg_be Messages postés 23541 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

j'ai une liste contient des données, mais j'ai fait un code de rechercher dans la liste.

je vous passe le rechercher Entrée : ( TEXT1.TEXT et Liste,)

Voir :

TEXT1.TEXT = "P1482"

Liste :
-------------------------------------------------------
N°ARTICLE|Prix TTC
-------------------------------------------------------
P1122------|500.00
P1144------|400.00
P1482------|500.00
P3366------|600.00
P8855------|700.00
P9955------|200.00
P4411------|100.00
P1548------|900.00
------------------------------------------------------
Mon code VB , si le numéro d'article (TEXT1.TEXT) existe dans La Liste s'affiche "OUI"
dans la text2.text sinon s'affiche "NON"

If TEXT1.Text <> "" Then
TEXT2.Text = ""
        For i = 1 To MSFlexGrid1.Rows - 1
                If MSFlexGrid1.TextMatrix(i, 0) = TEXT1.TEXT Then
                TEXT2.TEXT = "OUI"
                ElseIf MSFlexGrid1.TextMatrix(i, 0) <> TEXT1.TEXT Then
                TEXT2.TEXT = "NON"
                End If
        Next I
End If



Mais ce code marche pas !!!!!!!!!!!!!!!!!!!!!!
A voir également:

2 réponses

yg_be Messages postés 23541 Date d'inscription   Statut Contributeur Dernière intervention   Ambassadeur 1 584
 
bonsoir, "marche pas", message, d'erreur résultat inattendu?
petre-être ainsi:
TEXT2.Text = "NON"
        For i = 1 To MSFlexGrid1.Rows - 1
                If MSFlexGrid1.TextMatrix(i, 0) = TEXT1.TEXT Then
                       TEXT2.TEXT = "OUI"
                End If
        Next I
End If
0
accent19811 Messages postés 98 Date d'inscription   Statut Membre Dernière intervention  
 
Metci à votre réponse Mr, yg_be
0
yg_be Messages postés 23541 Date d'inscription   Statut Contributeur Dernière intervention   1 584
 
si c'est résolu, peux-tu le marquer comme résolu?
0