Re : Afficher / masquer optionbutton . En fonction valeur textbox. Dans le meme userf
ca ne marche toujours pas, ni bruno ni si.
C'est peut-être que je l'insert mal...
Private Sub TextBox2_Change() 'au changement de quantité
If TextBox2.Value = "" Then 'condition : si la quantité n'est pas renseignée
q = 0 'q=0
Else 'sinon
q = CInt(TextBox2.Value) 'q est égal à la quantité converti en entier
End If 'fin de la condition
If lbpri = "" Then 'condition : si le prix n'est pas indiqué
p = 0 'p=0
Else 'sinon
p = CDbl(lbpri.Caption) 'p est égal au prix converti en double
End If 'fin de la condition
t = q * p 'définit la valeur du prix total t
lbtot.Caption = Format(t, "#,##0.00") 'récupère le calcul du prix total au fomar décimal
TextBox4.Value = -(q - sto)
TextBox3.Value = (q - sto) + stomin
If TextBox3.Value <= 0 Then 'condition : si la textbox "a commander" est negative
TextBox3.Visible = False
Label13.Visible = False
Exit Sub 'sort de la procédure
End If 'fin de la condition
If TextBox3.Value > 0 Then 'condition : si la textbox "a commander" est negative
TextBox3.Visible = True
Label13.Visible = True
Exit Sub 'sort de la procédure
End If 'fin de la condition
'------------------------------
If CDbl(TextBox4.Value) < 0 Then 'condition : si la textbox "restante" est negative
UserForm1.OptionButton1.Visible = False
Exit Sub
End If
If CDbl(TextBox4.Value) > 0 Then 'condition : si la textbox "restante" est positive
UserForm1.OptionButton1.Visible = True
Exit Sub
End If
End Sub
qu'est-ce que vous en pensez ?
Merci pour vos réponses