Saludos, Quien me puede ayudar con esta programación, estoy iniciando dentro de este mundo desconocido.... buuuu
'Si Tipo = 1 %
'Si tipo = 2 Valor
Sub CalcularVTotal(Tipo As Integer)
Dim CantP As Long
Dim ValorP, ValorTotal As Currency
Dim TotalDesc As Currency
Dim PorcDes As Double
CantP = txtCant_Pro.Text
ValorP = txtPrecioV_Pro.Text
ValorTotal = CantP * ValorP
'calcular el Descuento
If Tipo = 1 Then '%
PorcDes = (txtPorcDescuentoPro / 100)
TotalDesc = PorcDes * ValorTotal
txtDescuentoVPro.Text = TotalDesc
ElseIf Tipo = 2 Then 'Valor
TotalDesc = CCur(txtDescuentoVPro)
PorcDes = (TotalDesc / ValorTotal)
PorcDes = Round(PorcDes, 1)
txtPorcDescuentoPro.Text = PorcDes
Else
TotalDesc = CCur(txtDescuentoVPro.Text) -Aquì me da ERROR:
End If
ValorTotal = ValorTotal - TotalDesc
txtValorTotalPro.Text = Format(ValorTotal, "currency")
End Sub
****************** "Error '13' en tiempo de ejecución - No coinciden los tipos****************