Désactiver une textbox sous condition d'une Combobox

chaelie2015

XLDnaute Accro
Bonjour Forum
je souhaite bloquer et vider la TextBox6 si la ComboBox5 ="NC" sinon revien a l'etat initiale
j'ai utilisé ce code
Code:
Private Sub ComboBox5__Change()
If ComboBox5 = "NC" Then
 TextBox6.Locked = False
 TextBox6.Enabled = False
 TextBox6.Value = ""
  
 Else
 TextBox6.Locked = True
 TextBox6.Enabled = True
 End If
End Sub
MAIS il revien pas a son etat initiale
SALUTATIONS
 

chaelie2015

XLDnaute Accro
Re : Désactiver une textbox sous condition d'une Combobox

Bonjour Forum
je souhaite bloquer et vider la TextBox6 si la ComboBox5 ="NC" sinon revien a l'etat initiale
j'ai utilisé ce code
Code:
Private Sub ComboBox5__Change()
If ComboBox5 = "NC" Then
 TextBox6.Locked = False
 TextBox6.Enabled = False
 TextBox6.Value = ""
  
 Else
 TextBox6.Locked = True
 TextBox6.Enabled = True
 End If
End Sub
MAIS il revien pas a son etat initiale
SALUTATIONS

Bonjour forum
PBLM Résolu
ci dessous la bonne réponse
Code:
Private Sub ComboBox5_Change()
If ComboBox5 = "NC" Then
 TextBox6.Locked = True
 TextBox6.Enabled = False
 TextBox6.Value = ""
 TextBox6.BackColor = &HC0FFC0
Else
 TextBox6.Locked = False
 TextBox6.Enabled = True
 TextBox6.BackColor = &HFF&
End If
End Sub
SALUTATIONS
 

Discussions similaires

Réponses
13
Affichages
414

Statistiques des forums

Discussions
314 226
Messages
2 107 512
Membres
109 855
dernier inscrit
Mcdo