I am working out an problem for my programming class and was wondering if I could get some help. The code below is supposed to do calculate a discount for specific model numbers (AX1 and SD2) at 10% off. All other inputs are to be discounted at 5%. What happens now with the code is just a flat message box with the original entered price.
Private Sub DiscountCalc_Click()
Dim strModelNum As String
Dim curOrigPrice As Currency
Dim sngRate As Long
Dim curDiscount As Long
Dim curNewPrice As Currency
strModelNum = InputBox("Enter desired model number", "Price Lookup")
strModelNum = UCase(strModelNum)
curOrigPrice = InputBox("Enter the original Price", "Price Lookup")
sngRate = 0.1
curDiscount = 0.05
If strModelNum = "AX1" Then
curNewPrice = curOrigPrice - (curOrigPrice * sngRate)
Else
If strModelNum = "SD2" Then
curNewPrice = curOrigPrice - (curOrigPrice * sngRate)
Else
curNewPrice = curOrigPrice - (curOrigPrice * curDiscount)
End If
End If
MsgBox curNewPrice
End Sub
Thank you!
Aucun commentaire:
Enregistrer un commentaire