Bonjour à tous,
J'ai un petit problème de formulaire. Il contient 5 checkboxes + 1 (checkbox 6) qui permet de tout cocher tout décocher.
Le problème est le suivante : quand je clique sur n'importe laquelle des checkboxes (1 à 5) , tout se décoche alors que je voudrais juste décocher la case 6 (tout cocher/décocher) pour que ce soit logique
voila le code
Private Sub CheckBox1_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox2_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox3_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox4_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox5_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox6_Click()
If CheckBox6.Value = False Then
CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False
CheckBox4.Value = False
CheckBox5.Value = False
CheckBox6.Value = False
End If
End Sub
Function Testcompatibilité1()
If CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = True And CheckBox4.Value = True And CheckBox5.Value = True Then
CheckBox6.Value = True
End If
End Function
Function Testcompatibilité2()
If CheckBox1.Value = False Or CheckBox2.Value = False Or CheckBox3.Value = False Or CheckBox4.Value = False Or CheckBox5.Value = False Then
CheckBox6.Value = False
End If
End Function
PS : je vous mets une photo du formulaire pour que ce soit plus pratique
J'ai un petit problème de formulaire. Il contient 5 checkboxes + 1 (checkbox 6) qui permet de tout cocher tout décocher.
Le problème est le suivante : quand je clique sur n'importe laquelle des checkboxes (1 à 5) , tout se décoche alors que je voudrais juste décocher la case 6 (tout cocher/décocher) pour que ce soit logique
voila le code
Private Sub CheckBox1_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox2_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox3_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox4_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox5_Click()
Call Testcompatibilité1
Call Testcompatibilité2
End Sub
Private Sub CheckBox6_Click()
If CheckBox6.Value = False Then
CheckBox1.Value = False
CheckBox2.Value = False
CheckBox3.Value = False
CheckBox4.Value = False
CheckBox5.Value = False
CheckBox6.Value = False
End If
End Sub
Function Testcompatibilité1()
If CheckBox1.Value = True And CheckBox2.Value = True And CheckBox3.Value = True And CheckBox4.Value = True And CheckBox5.Value = True Then
CheckBox6.Value = True
End If
End Function
Function Testcompatibilité2()
If CheckBox1.Value = False Or CheckBox2.Value = False Or CheckBox3.Value = False Or CheckBox4.Value = False Or CheckBox5.Value = False Then
CheckBox6.Value = False
End If
End Function
PS : je vous mets une photo du formulaire pour que ce soit plus pratique