Bonjour à tous
je souhaite changer cette partie de code :
par celle ci pour reduire le nombre de ligne de code
Le problème c'est que ca ne marche plus, j'ai besoin d'un oeil extérieur pour voir ce qui cloche.
Merci pour toute aide.
@+
je souhaite changer cette partie de code :
Code:
If ComboBox3.Value = "1" Or ComboBox5.Value = "1" Or ComboBox7.Value = "1" Or ComboBox9.Value = "1" Then
CheckBox1.Value = True
End If
If ComboBox3.Value = "2" Or ComboBox5.Value = "2" Or ComboBox7.Value = "2" Or ComboBox9.Value = "2" Then
CheckBox2.Value = True
End If
If ComboBox3.Value = "3" Or ComboBox5.Value = "3" Or ComboBox7.Value = "3" Or ComboBox9.Value = "3" Then
CheckBox3.Value = True
End If
If ComboBox3.Value = "4" Or ComboBox5.Value = "4" Or ComboBox7.Value = "4" Or ComboBox9.Value = "4" Then
CheckBox4.Value = True
End If
If ComboBox3.Value = "5" Or ComboBox5.Value = "5" Or ComboBox7.Value = "5" Or ComboBox9.Value = "5" Then
CheckBox5.Value = True
End If
If ComboBox3.Value = "6" Or ComboBox5.Value = "6" Or ComboBox7.Value = "6" Or ComboBox9.Value = "6" Then
CheckBox6.Value = True
End If
If ComboBox3.Value = "7" Or ComboBox5.Value = "7" Or ComboBox7.Value = "7" Or ComboBox9.Value = "7" Then
CheckBox7.Value = True
End If
If ComboBox3.Value = "8" Or ComboBox5.Value = "8" Or ComboBox7.Value = "8" Or ComboBox9.Value = "8" Then
CheckBox8.Value = True
End If
par celle ci pour reduire le nombre de ligne de code
Code:
For i = 1 To 8
If ComboBox3.Value = "" & i Or ComboBox5.Value = "" & i Or ComboBox7.Value = "" & i Or ComboBox9.Value = "" & i Then
Me.Controls("CheckBox" & i).Value = True
End If
Next i
Le problème c'est que ca ne marche plus, j'ai besoin d'un oeil extérieur pour voir ce qui cloche.
Merci pour toute aide.
@+