Super merci de ton aide , je test ca ![:)](https://www.developpez.net/forums/images/smilies/icon_smile.gif)
pourtant j'avais cherché dans les anciens posts
j'ai donc eté voir sur l'autre post mais je ne comprend pas (dans l'exemple il y a un mais moi le DAO.RecordSet il est non reconnu
je me permets donc de mettre mon code :
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
| Private Sub ClickCap_Click()
If Me.ClickCap Then
Me.MenuCap.Visible = False
Else
Me.MenuCap.Visible = True
End If
RefreshQuery
End Sub
Private Sub ClickCrite_Click()
If Me.ClickCrite Then
Me.MenuCrit.Visible = False
Else
Me.MenuCrit.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickEntenduMesure_Click()
If Me.ClickEntenduMesure Then
Me.MenuEtendueMesure.Visible = False
Else
Me.MenuEtendueMesure.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickFab_Click()
If Me.ClickFab Then
Me.menuFab.Visible = False
Else
Me.menuFab.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickFonc_Click()
If Me.ClickFonc Then
Me.menuFonc.Visible = False
Else
Me.menuFonc.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickForme_Click()
If Me.ClickForme Then
Me.menuForme.Visible = False
Else
Me.menuForme.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickMinMax_Click()
If Me.ClickMinMax Then
Me.menuMinMax.Visible = False
Else
Me.menuMinMax.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickPression_Click()
If Me.ClickPression Then
Me.menuPression.Visible = False
Else
Me.menuPression.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickPyro_Click()
If Me.ClickPyro Then
Me.MenuPyro.Visible = False
Else
Me.MenuPyro.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickSens_Click()
If Me.ClickSens Then
Me.MenuElementSensible.Visible = False
Else
Me.MenuElementSensible.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickSign_Click()
If Me.ClickSign Then
Me.MenuSign.Visible = False
Else
Me.MenuSign.Visible = True
End If
'RefreshQuery
End Sub
Private Sub ClickTypeMesure_Click()
If Me.ClickTypeMesure Then
Me.MenuTypeMesure.Visible = False
Else
Me.MenuTypeMesure.Visible = True
End If
'RefreshQuery
End Sub
Private Sub Form_Load()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case Left(ctl.Name, 3)
Case "cli"
ctl.Value = -1
Case "lbl"
ctl.Caption = "- * - * -"
Case "men"
ctl.Visible = False
End Select
Next ctl
End Sub
Private Sub RefreshQuery()
Dim SQL As String
Dim SQLWhere As String
SQL = "SELECT Capteurs.Nom_Cap as Key_Cap, Criteres.Types as Key_Crit FROM Criteres INNER JOIN Capteurs ON Criteres.Key_Crit=Capteurs.Val_Crit "
If Not Me.ClickCap Then
SQL = SQL & "And Capteurs.Nom_Cap like '" & Me.MenuCap & "' "
End If
SQLWhere = Trim(Right(SQL, Len(SQL) - InStr(SQL, "Where ") - Len("Where ") + 1))
SQL = SQL & ";"
Me.lblStats.Caption = DCount("*", "Capteurs", SQLWhere) & " / " & DCount("*", "Capteurs")
Me.lstResults.RowSource = SQL
Me.lstResults.Requery
End Sub
Private Sub MenuCap_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub MenuCrit_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub MenuElementSensible_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub MenuEtendueMesure_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub menuFab_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub menuFonc_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub menuForme_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub menuMinMax_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub menuPression_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub MenuPyro_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub MenuSign_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub
Private Sub MenuTypeMesure_BeforeUpdate(Cancel As Integer)
RefreshQuery
End Sub |
juste pour info quand je lance l'application je vois bien mon tableau, dans LstResult -> contenu j'ai :
SELECT Capteurs.Nom_Cap, Criteres.Types, Element_Sensible.Elem_Sensi, Etendue_Mesure.Val_entendue_mesure, Fabricants.Nom_fab, Fonctionnement.Type_Fonct, Forme.Forme, Mesure_Etendue_MM.Val_mm, Signal_Sortie.Type_signal_sortie, Type_Mesure.Nom_Type_Mesure, Type_Pression.Type_Pression, Type_Pyro.Type_Pyro FROM Type_Pyro INNER JOIN (Type_Pression INNER JOIN (Type_Mesure INNER JOIN (Signal_Sortie INNER JOIN (Mesure_Etendue_MM INNER JOIN (Forme INNER JOIN (Fonctionnement INNER JOIN (Fabricants INNER JOIN (Etendue_Mesure INNER JOIN (Element_Sensible INNER JOIN (Criteres INNER JOIN Capteurs ON Criteres.Key_Crit=Capteurs.Val_Crit) ON Element_Sensible.Key_Sensi=Capteurs.Val_Sensi) ON Etendue_Mesure.Key_entendue_mesure=Capteurs.Val_entendue_mesure) ON Fabricants.Key_fab=Capteurs.Val_fab) ON Fonctionnement.Key_Fonct=Capteurs.Val_Fonct) ON Forme.Key_Forme=Capteurs.Val_Forme) ON Mesure_Etendue_MM.key_eten_mm=Capteurs.Val_eten_mm) ON Signal_Sortie.Key_signal=Capteurs.Val_signal) ON Type_Mesure.Key_type_mesure=Capteurs.Val_type_mesure) ON Type_Pression.Key_Press=Capteurs.Val_Press) ON Type_Pyro.Key_Pyro=Capteurs.Val_Pyro ORDER BY Capteurs.Nom_Cap;
et ca marche super bien, si quelqu'un pouvait me dire comment bien faire mon RefreshQuery()
Merci d'avance.
Partager