Sub Affiche()
Set dchoisis1 = CreateObject("Scripting.Dictionary")
For i = 0 To Me.OptionsGenre.ListCount - 1
If Me.OptionsGenre.Selected(i) Then dchoisis1(Me.OptionsGenre.List(i, 0)) = ""
Next i
Set dchoisis2 = CreateObject("Scripting.Dictionary")
For i = 0 To Me.OptionsArtiste.ListCount - 1
If Me.OptionsArtiste.Selected(i) Then dchoisis2(Me.OptionsArtiste.List(i, 0)) = ""
Next i
Set dchoisis3 = CreateObject("Scripting.Dictionary")
For i = 0 To Me.OptionAlbum.ListCount - 1
If Me.OptionAlbum.Selected(i) Then dchoisis3(Me.OptionAlbum.List(i, 0)) = ""
Set dchoisis4 = CreateObject("Scripting.Dictionary")
Next i
[COLOR=rgb(247, 218, 100)]Set dchoisis4 = CreateObject("Scripting.Dictionary")
For i = 0 To Me.OptionIntervenant.ListCount - 1
If Me.OptionIntervenant.Selected(i) Then dchoisis4(Me.OptionIntervenant.List(i, 0)) = ""
Next i
Dim Tbl2(): N = 0: Ncol = UBound(TblBD, 2)
For i = 1 To UBound(TblBD)
tmp13 = TblBD(i, 13): tmp14 = TblBD(i, 14):: tmp15 = TblBD(i, 15): tmp16 = TblBD(i, 16): tmp17 = TblBD(i, 17): tmp2 = TblBD(i, 5): tmp3 = TblBD(i, 6):[COLOR=rgb(247, 218, 100)] tmp4 = TblBD(i, 18)
la comment mettre (i, 18 à 22) ???[/COLOR]
If ((dchoisis1.exists(tmp13) Or dchoisis1.Count = 0) Or (dchoisis1.exists(tmp14) Or dchoisis1.Count = 0) Or (dchoisis1.exists(tmp15) Or dchoisis1.Count = 0) Or (dchoisis1.exists(tmp16) Or dchoisis1.Count = 0) Or (dchoisis1.exists(tmp17) Or dchoisis1.Count = 0)) And (dchoisis2.exists(tmp2) Or dchoisis2.Count = 0) And (dchoisis3.exists(tmp3) Or dchoisis3.Count = 0) And (dchoisis4.exists(tmp4) Or dchoisis4.Count = 0) Then
N = N + 1: ReDim Preserve Tbl2(1 To Ncol, 1 To N)
For k = 1 To Ncol: Tbl2(k, N) = TblBD(i, k): Next k
End If
Next i
If N > 0 Then Me.ListBox1.Column = Tbl2 Else Me.ListBox1.Clear
Me.LabelLigne.Caption = N & " élèves"
End Sub
Sub Tri(a, gauc, droi) ' Quick sort
ref = CStr(a((gauc + droi) \ 2))
g = gauc: d = droi
Do
Do While CStr(a(g)) < ref: g = g + 1: Loop
Do While ref < CStr(a(d)): d = d - 1: Loop
If g <= d Then
temp = a(g): a(g) = a(d): a(d) = temp
g = g + 1: d = d - 1
End If
Loop While g <= d
If g < droi Then Call Tri(a, g, droi)
If gauc < d Then Call Tri(a, gauc, d)
End Sub