Bonjour,
Ce que je désire faire : après choix sur differentes combobox et après avoir cliqué sur un bouton certaines checkbox doivent "se" cocher. On doit pouvoir continuer a faire des choix sur les differentes combobox et réappuyer sur le bouton, mais si tel ou tel checkbox est deja cochée apparait un message d'erreur.
Mon problème: les combobox sont faites, le bouton aussi, les checkbox et tout ce qui s'en suit aussi, le seul probleme est que le message d'erreur apparait dès le premier choix. Ci-après le morceau de code impliqué :
Et petite question comment peut on fixer la barre de défilement liée a une textbox en effet la mienne apparait que lorsque l'on clique sur la textbox et je voudrais qu'on la voie avant de cliquer dessus
Merci d'avance pour toute aide.
Ce que je désire faire : après choix sur differentes combobox et après avoir cliqué sur un bouton certaines checkbox doivent "se" cocher. On doit pouvoir continuer a faire des choix sur les differentes combobox et réappuyer sur le bouton, mais si tel ou tel checkbox est deja cochée apparait un message d'erreur.
Mon problème: les combobox sont faites, le bouton aussi, les checkbox et tout ce qui s'en suit aussi, le seul probleme est que le message d'erreur apparait dès le premier choix. Ci-après le morceau de code impliqué :
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
If CheckBox1.Value = True And (ComboBox3.Value = "1" Or ComboBox5.Value = "1" Or ComboBox7.Value = "1" Or ComboBox9.Value = "1") Then
MsgBox "L'adresse 1 est déjà utilisée", vbCritical
End If
If CheckBox2.Value = True And (ComboBox3.Value = "2" Or ComboBox5.Value = "2" Or ComboBox7.Value = "2" Or ComboBox9.Value = "2") Then
MsgBox "L'adresse 2 est déjà utilisée", vbCritical
End If
If CheckBox3.Value = True And (ComboBox3.Value = "3" Or ComboBox5.Value = "3" Or ComboBox7.Value = "3" Or ComboBox9.Value = "3") Then
MsgBox "L'adresse 3 est déjà utilisée", vbCritical
End If
If CheckBox4.Value = True And (ComboBox3.Value = "4" Or ComboBox5.Value = "4" Or ComboBox7.Value = "4" Or ComboBox9.Value = "4") Then
MsgBox "L'adresse 4 est déjà utilisée", vbCritical
End If
If CheckBox5.Value = True And (ComboBox3.Value = "5" Or ComboBox5.Value = "5" Or ComboBox7.Value = "5" Or ComboBox9.Value = "5") Then
MsgBox "L'adresse 5 est déjà utilisée", vbCritical
End If
If CheckBox6.Value = True And (ComboBox3.Value = "6" Or ComboBox5.Value = "6" Or ComboBox7.Value = "6" Or ComboBox9.Value = "6") Then
MsgBox "L'adresse 6 est déjà utilisée", vbCritical
End If
If CheckBox7.Value = True And (ComboBox3.Value = "7" Or ComboBox5.Value = "7" Or ComboBox7.Value = "7" Or ComboBox9.Value = "7") Then
MsgBox "L'adresse 7 est déjà utilisée", vbCritical
End If
If CheckBox8.Value = True And (ComboBox3.Value = "8" Or ComboBox5.Value = "8" Or ComboBox7.Value = "8" Or ComboBox9.Value = "8") Then
MsgBox "L'adresse 8 est déjà utilisée", vbCritical
End If
Et petite question comment peut on fixer la barre de défilement liée a une textbox en effet la mienne apparait que lorsque l'on clique sur la textbox et je voudrais qu'on la voie avant de cliquer dessus
Merci d'avance pour toute aide.
Dernière édition: