Private Sub ComboBox2_Change()
' Filtre sélectif de la liste des Tiers par catégorie (Clients ou Fournisseurs)
' ******************************************************************************
' Application.ScreenUpdating = False 'déjà dans initialise
Dim i As Byte
Dim CEL As Range
If Me.ComboBox2 <> "" Then
Me.ComboBox2.Value = Format(Me.ComboBox2.Value, "00")
Me.TextBox4.Visible = True
With Feuil3
Me.TextBox4 = .Cells(Me.ComboBox2.ListIndex + 2, 2)
End With
TEST = False
Me.ComboBox3.Clear
For i = LBound(TCI) To UBound(TCI)
If Me.ComboBox2.Value = TCI(i) Then TEST = True: Exit For
Next
If TEST = True And Me.ComboBox2.Value <> 42 Then TEST = True
If TEST = False Then
Me.ComboBox3.Enabled = False
Else
Me.ComboBox3.Enabled = True
End If
If Me.ComboBox2 Like "0[2-8]" Then
For Each CEL In Feuil2.[planTiers_NumTiers]
If Left(CEL.Value, 1) = "0" Then Me.ComboBox3.AddItem CEL.Value
Next CEL
End If
If Me.ComboBox2.Value = 42 Then
TEST = True
For Each CEL In Feuil2.[planTiers_NumTiers]
If Left(CEL.Value, 1) = "F" Then Me.ComboBox3.AddItem CEL.Value
Next CEL
Me.ComboBox3.Enabled = True
End If
End If
'Me.ComboBox3.Enabled = TEST
End Sub
' Affiche pour vérification de la Raison sociale du Tiers concerné
' -------------------------------------------------------------------------------------
Private Sub ComboBox3_Change()
If Me.ComboBox3 <> "" Then
Me.TextBox5.Visible = True
With Feuil2
Me.TextBox5 = .Cells(Me.ComboBox3.ListIndex + 2, 1)
End With
End If
End Sub