IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB 6 et antérieur Discussion :

afficher sur msflexgrid un resultat de recherche


Sujet :

VB 6 et antérieur

  1. #1
    Nouveau membre du Club
    Inscrit en
    Juin 2009
    Messages
    48
    Détails du profil
    Informations personnelles :
    Âge : 36

    Informations forums :
    Inscription : Juin 2009
    Messages : 48
    Points : 29
    Points
    29
    Par défaut afficher sur msflexgrid un resultat de recherche
    salut a tous

    je veux effectuer un recherche ensuit j'affiche le resultat abouti par l'msflexgrid

    la probilamiyique quant j fait un dexieme recherche il vide l'antient champ dans l'msflexgrid et ajout a lui les nouveaux champ trouve

    j'ai pense a une command me permet de vide l'msflexgrid achaque nouveaux recherche ... je conne la command "MSFlexGrid1.Clear" mais celle si elle ne supprime pas l'entient champ existant dans l'msflexgrid ...

    est ce que vous pouvez m'aider et merci d'avance )

  2. #2
    Membre régulier
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2005
    Messages
    65
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Sénégal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2005
    Messages : 65
    Points : 88
    Points
    88
    Par défaut
    Bonjour,
    Ce n'est pas impossible à condition que vous précisez ce qui est recherché et comment tu l'affiche. Si tu pouvez posté ton bout de code.
    Bon courage
    Cordialement

  3. #3
    Nouveau membre du Club
    Inscrit en
    Juin 2009
    Messages
    48
    Détails du profil
    Informations personnelles :
    Âge : 36

    Informations forums :
    Inscription : Juin 2009
    Messages : 48
    Points : 29
    Points
    29
    Par défaut
    Citation Envoyé par Bilxadim Voir le message
    Bonjour,
    Ce n'est pas impossible à condition que vous précisez ce qui est recherché et comment tu l'affiche. Si tu pouvez posté ton bout de code.
    Bon courage
    Cordialement
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    --------------
        Set rech = bs.OpenRecordset("select * from wajdi where nom='" & Text1.Text & "'")
            If rech.EOF Then
            MsgBox "Vérifier le Nom ...", vbCritical + vbOKOnly, "Nom non trouver"
            Else
                If rech![nom] <> text1.text Then
                rech.MoveFirst
                    While rech.EOF = False
            MSFlexGrid1.Clear
            MSFlexGrid1.TextMatrix(0, 1) = "Nom"
            MSFlexGrid1.ColWidth(0) = 0
            MSFlexGrid1.ColWidth(1) = 1500
            MSFlexGrid1.TextMatrix(0, 2) = "Prénom"
            MSFlexGrid1.ColWidth(2) = 1500
            MSFlexGrid1.TextMatrix(0, 3) = "C.I.N"
            MSFlexGrid1.ColWidth(3) = 1500
            MSFlexGrid1.TextMatrix(0, 4) = "Proffession"
            MSFlexGrid1.ColWidth(4) = 1500
            MSFlexGrid1.TextMatrix(0, 5) = "Date de naissance"
            MSFlexGrid1.ColWidth(5) = 1500
            MSFlexGrid1.TextMatrix(0, 6) = "Code Puk"
            MSFlexGrid1.ColWidth(6) = 1500
            MSFlexGrid1.TextMatrix(0, 7) = "Code Postal"
            MSFlexGrid1.ColWidth(7) = 1500
            MSFlexGrid1.TextMatrix(0, 8) = "Adresse"
            MSFlexGrid1.ColWidth(8) = 3000
     
                    MSFlexGrid1.AddItem "", t
                    MSFlexGrid1.TextMatrix(t, 1) = rech![nom]
                    MSFlexGrid1.TextMatrix(t, 2) = rech![prenom]
                    MSFlexGrid1.TextMatrix(t, 3) = rech![cin]
                    MSFlexGrid1.TextMatrix(t, 4) = rech![proffession]
                    MSFlexGrid1.TextMatrix(t, 5) = rech![jour]
                    MSFlexGrid1.TextMatrix(t, 6) = rech![codepuk]
                    MSFlexGrid1.TextMatrix(t, 7) = rech![code]
                    MSFlexGrid1.TextMatrix(t, 8) = rech![adresse]
                    t = t + 1
                    rech.MoveNext
          Wend
                End If
            End If
    --------------

    voila une partie de code

  4. #4
    Expert éminent sénior
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 105
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 105
    Points : 16 627
    Points
    16 627
    Par défaut
    Pas de Up sur DVP.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
            While rech.EOF = False
     
                '******* que va-t-il ce passer au second passage ? **************************
                MSFlexGrid1.Clear '<= Efface le contenu de la FlexGrid, c'est-à-dire le texte,
                                  'les images et le formatage des cellules.
     
                MSFlexGrid1.TextMatrix(0, 1) = "Nom"
                MSFlexGrid1.ColWidth(0) = 0
                MSFlexGrid1.ColWidth(1) = 1500
                MSFlexGrid1.TextMatrix(0, 2) = "Prénom"
                MSFlexGrid1.ColWidth(2) = 1500
                MSFlexGrid1.TextMatrix(0, 3) = "C.I.N"
                MSFlexGrid1.ColWidth(3) = 1500
                MSFlexGrid1.TextMatrix(0, 4) = "Proffession"
                MSFlexGrid1.ColWidth(4) = 1500
                MSFlexGrid1.TextMatrix(0, 5) = "Date de naissance"
                MSFlexGrid1.ColWidth(5) = 1500
                MSFlexGrid1.TextMatrix(0, 6) = "Code Puk"
                MSFlexGrid1.ColWidth(6) = 1500
                MSFlexGrid1.TextMatrix(0, 7) = "Code Postal"
                MSFlexGrid1.ColWidth(7) = 1500
                MSFlexGrid1.TextMatrix(0, 8) = "Adresse"
                MSFlexGrid1.ColWidth(8) = 3000
     
                MSFlexGrid1.AddItem "", t
                MSFlexGrid1.TextMatrix(t, 1) = rech![nom]
                MSFlexGrid1.TextMatrix(t, 2) = rech![prenom]
                MSFlexGrid1.TextMatrix(t, 3) = rech![cin]
                MSFlexGrid1.TextMatrix(t, 4) = rech![proffession]
                MSFlexGrid1.TextMatrix(t, 5) = rech![jour]
                MSFlexGrid1.TextMatrix(t, 6) = rech![codepuk]
                MSFlexGrid1.TextMatrix(t, 7) = rech![code]
                MSFlexGrid1.TextMatrix(t, 8) = rech![adresse]
                t = t + 1
                rech.MoveNext '<passe a l'enregistrement suivant
                'branchement en debut de While, si rech.EOF = true recommance la boucle
            Wend
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    Set rech = bs.OpenRecordset("select * from wajdi where nom='" & text1.Text & "'")
    If rech.EOF Then
        MsgBox "Vérifier le Nom ...", vbCritical + vbOKOnly, "Nom non trouver"
        Else
        If rech![nom] <> text1.Text Then
            MSFlexGrid1.Clear '<= Efface le contenu de la FlexGrid
            MSFlexGrid1.TextMatrix(0, 1) = "Nom"
            MSFlexGrid1.ColWidth(0) = 0
            MSFlexGrid1.ColWidth(1) = 1500
            MSFlexGrid1.TextMatrix(0, 2) = "Prénom"
            MSFlexGrid1.ColWidth(2) = 1500
            MSFlexGrid1.TextMatrix(0, 3) = "C.I.N"
            MSFlexGrid1.ColWidth(3) = 1500
            MSFlexGrid1.TextMatrix(0, 4) = "Proffession"
            MSFlexGrid1.ColWidth(4) = 1500
            MSFlexGrid1.TextMatrix(0, 5) = "Date de naissance"
            MSFlexGrid1.ColWidth(5) = 1500
            MSFlexGrid1.TextMatrix(0, 6) = "Code Puk"
            MSFlexGrid1.ColWidth(6) = 1500
            MSFlexGrid1.TextMatrix(0, 7) = "Code Postal"
            MSFlexGrid1.ColWidth(7) = 1500
            MSFlexGrid1.TextMatrix(0, 8) = "Adresse"
            MSFlexGrid1.ColWidth(8) = 3000
            t = 1
            rech.MoveFirst
            While rech.EOF = False
     
                MSFlexGrid1.AddItem "", t
                MSFlexGrid1.TextMatrix(t, 1) = rech![nom]
                MSFlexGrid1.TextMatrix(t, 2) = rech![prenom]
                MSFlexGrid1.TextMatrix(t, 3) = rech![cin]
                MSFlexGrid1.TextMatrix(t, 4) = rech![proffession]
                MSFlexGrid1.TextMatrix(t, 5) = rech![jour]
                MSFlexGrid1.TextMatrix(t, 6) = rech![codepuk]
                MSFlexGrid1.TextMatrix(t, 7) = rech![code]
                MSFlexGrid1.TextMatrix(t, 8) = rech![adresse]
                t = t + 1
                rech.MoveNext
            Wend
        End If
    End If
    La solution, si j'ai bien compris ton probléme

  5. #5
    Nouveau membre du Club
    Inscrit en
    Juin 2009
    Messages
    48
    Détails du profil
    Informations personnelles :
    Âge : 36

    Informations forums :
    Inscription : Juin 2009
    Messages : 48
    Points : 29
    Points
    29
    Par défaut
    Citation Envoyé par ProgElecT Voir le message
    Pas de Up sur DVP.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
            While rech.EOF = False
     
                '******* que va-t-il ce passer au second passage ? **************************
                MSFlexGrid1.Clear '<= Efface le contenu de la FlexGrid, c'est-à-dire le texte,
                                  'les images et le formatage des cellules.
     
                MSFlexGrid1.TextMatrix(0, 1) = "Nom"
                MSFlexGrid1.ColWidth(0) = 0
                MSFlexGrid1.ColWidth(1) = 1500
                MSFlexGrid1.TextMatrix(0, 2) = "Prénom"
                MSFlexGrid1.ColWidth(2) = 1500
                MSFlexGrid1.TextMatrix(0, 3) = "C.I.N"
                MSFlexGrid1.ColWidth(3) = 1500
                MSFlexGrid1.TextMatrix(0, 4) = "Proffession"
                MSFlexGrid1.ColWidth(4) = 1500
                MSFlexGrid1.TextMatrix(0, 5) = "Date de naissance"
                MSFlexGrid1.ColWidth(5) = 1500
                MSFlexGrid1.TextMatrix(0, 6) = "Code Puk"
                MSFlexGrid1.ColWidth(6) = 1500
                MSFlexGrid1.TextMatrix(0, 7) = "Code Postal"
                MSFlexGrid1.ColWidth(7) = 1500
                MSFlexGrid1.TextMatrix(0, 8) = "Adresse"
                MSFlexGrid1.ColWidth(8) = 3000
     
                MSFlexGrid1.AddItem "", t
                MSFlexGrid1.TextMatrix(t, 1) = rech![nom]
                MSFlexGrid1.TextMatrix(t, 2) = rech![prenom]
                MSFlexGrid1.TextMatrix(t, 3) = rech![cin]
                MSFlexGrid1.TextMatrix(t, 4) = rech![proffession]
                MSFlexGrid1.TextMatrix(t, 5) = rech![jour]
                MSFlexGrid1.TextMatrix(t, 6) = rech![codepuk]
                MSFlexGrid1.TextMatrix(t, 7) = rech![code]
                MSFlexGrid1.TextMatrix(t, 8) = rech![adresse]
                t = t + 1
                rech.MoveNext '<passe a l'enregistrement suivant
                'branchement en debut de While, si rech.EOF = true recommance la boucle
            Wend
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    Set rech = bs.OpenRecordset("select * from wajdi where nom='" & text1.Text & "'")
    If rech.EOF Then
        MsgBox "Vérifier le Nom ...", vbCritical + vbOKOnly, "Nom non trouver"
        Else
        If rech![nom] <> text1.Text Then
            MSFlexGrid1.Clear '<= Efface le contenu de la FlexGrid
            MSFlexGrid1.TextMatrix(0, 1) = "Nom"
            MSFlexGrid1.ColWidth(0) = 0
            MSFlexGrid1.ColWidth(1) = 1500
            MSFlexGrid1.TextMatrix(0, 2) = "Prénom"
            MSFlexGrid1.ColWidth(2) = 1500
            MSFlexGrid1.TextMatrix(0, 3) = "C.I.N"
            MSFlexGrid1.ColWidth(3) = 1500
            MSFlexGrid1.TextMatrix(0, 4) = "Proffession"
            MSFlexGrid1.ColWidth(4) = 1500
            MSFlexGrid1.TextMatrix(0, 5) = "Date de naissance"
            MSFlexGrid1.ColWidth(5) = 1500
            MSFlexGrid1.TextMatrix(0, 6) = "Code Puk"
            MSFlexGrid1.ColWidth(6) = 1500
            MSFlexGrid1.TextMatrix(0, 7) = "Code Postal"
            MSFlexGrid1.ColWidth(7) = 1500
            MSFlexGrid1.TextMatrix(0, 8) = "Adresse"
            MSFlexGrid1.ColWidth(8) = 3000
            t = 1
            rech.MoveFirst
            While rech.EOF = False
     
                MSFlexGrid1.AddItem "", t
                MSFlexGrid1.TextMatrix(t, 1) = rech![nom]
                MSFlexGrid1.TextMatrix(t, 2) = rech![prenom]
                MSFlexGrid1.TextMatrix(t, 3) = rech![cin]
                MSFlexGrid1.TextMatrix(t, 4) = rech![proffession]
                MSFlexGrid1.TextMatrix(t, 5) = rech![jour]
                MSFlexGrid1.TextMatrix(t, 6) = rech![codepuk]
                MSFlexGrid1.TextMatrix(t, 7) = rech![code]
                MSFlexGrid1.TextMatrix(t, 8) = rech![adresse]
                t = t + 1
                rech.MoveNext
            Wend
        End If
    End If
    La solution, si j'ai bien compris ton probléme
    ---------------

    merci frère pour ton aide je trouve la solution il faut que j remplace

    MSFlexGrid1.Clear
    par
    msflexgrid1.rows=1




    merci une autre fois

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Drupal] Afficher puis filtrer les resultats de recherche avec search api solr
    Par tigunn dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 11/03/2013, 16h11
  2. afficher les resultats de recherche dans la meme page.
    Par geeksDeve dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 09/04/2012, 03h09
  3. Réponses: 1
    Dernier message: 27/12/2011, 14h13
  4. afficher sur une nouvelle page un resultat de combobox
    Par ruza01 dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 19/01/2009, 14h03
  5. Etat en fonction du resultat affiché sur un formulaire
    Par GoldHofer dans le forum Access
    Réponses: 10
    Dernier message: 15/05/2006, 15h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo