Reputation: 101
Here is the code I am trying:
If txtMonths >= 1 And txtMonths <= 6 Then
additionalDiscount = 0
Upvotes: 0
Views: 2454
Reputation: 311853
intMonths
is a TextBox
, not an int
, so you can't just use it as an int
. You'd have to extract its textual value and convert it to an int
first:
Dim intMonthsVal As Integer = Integer.Parse(txtMonths.Text)
If intMonthsVal >= 1 AndAlso intMonthsVal <= 6 Then
additionalDiscount = 0
End If
Upvotes: 4