Problème code vba
Végéta84
Messages postés
2
Statut
Membre
-
Végéta84 Messages postés 2 Statut Membre -
Végéta84 Messages postés 2 Statut Membre -
Bonjour,
Je suis débutant en programation vba et je suis face à une erreur de compilation.
Voici mon code:
Private Sub ComboBox1_Change()
End Sub
Private Function Tarif(str_Typetransport As String)
If (str_Typetransport.Text = "Lent") Then Tarif.Value = 0
If (str_Typetransport.Text = "Urgent") Then Tarif.Value = 12
If (str_Typetransport.Text = "Porteur spécial") Then Tarif.Value = 23
End Function
Private Sub Bouton_Click(Tarif As object)
If (Nbcolis.Value < 5) Then Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value Else: Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value * 0.9
End Sub
Private Sub Fraisexp_Change()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub Remise_Change()
End Sub
Private Sub Destination_Change()
End Sub
Private Sub Typetransport_Change()
End Sub
Toute aide est la bienvenue !!!!
merci
Je suis débutant en programation vba et je suis face à une erreur de compilation.
Voici mon code:
Private Sub ComboBox1_Change()
End Sub
Private Function Tarif(str_Typetransport As String)
If (str_Typetransport.Text = "Lent") Then Tarif.Value = 0
If (str_Typetransport.Text = "Urgent") Then Tarif.Value = 12
If (str_Typetransport.Text = "Porteur spécial") Then Tarif.Value = 23
End Function
Private Sub Bouton_Click(Tarif As object)
If (Nbcolis.Value < 5) Then Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value Else: Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value * 0.9
End Sub
Private Sub Fraisexp_Change()
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub Remise_Change()
End Sub
Private Sub Destination_Change()
End Sub
Private Sub Typetransport_Change()
End Sub
Toute aide est la bienvenue !!!!
merci
Configuration: Windows Vista Internet Explorer 7.0
2 réponses
-
Private Sub Bouton_Click(Tarif As object)
If (Nbcolis.Value < 5) Then Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value Else: Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value * 0.9
End Sub
tin if? ias tu mis tout ton code?
normalement ton if devrai etre former comme ca
if (Nbcolis.Value < 5) Then
Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value
Else
Fraisexp.Caption = (Destination.Value + Tarif.Value) * Nbcolis.Value * 0.9
end if -
J'ai fais la modif mais ça ne change rien. J'ai toujours la déclaration surlignée avec la mention "erreur de compilation; la declaration de la procedure ne correspond pas a la description de l'evenement ou la procedure du meme nom"