I would start with the If Then block...
I am not familiar with VB but I am just trying to help
If QuantityPurchased >= 1 And QuantityPurchased <= 10 Then
SalesDiscRate = 5%
End If
If QuantityPurchased >= 11 And QuantityPurchased <= 20 Then
SalesDiscRate = 10%
Else
If QuantityPurchased >= 21 Then
SalesDiscRate = 15%
End If
End If