D
Don
I asked a question earlier today and was told to use select case to address
my need. I ended up doing so, but there is a small issue I didn't cover. My
original question concerned figuring commissions for sales people. I am
inserting the MVP's suggested code--it worked fine; however, I have a field
in my query called "FULL" that determines whether my sales people earn full
commission or partial commission.
Function fCommission(nCommission As Variant) As Variant
Dim TheCommission As Variant
Select Case nCommission
Case Is < 10
TheCommission = 0
Case 10 To 19.999
TheCommission = 5
Case 20 To 29.999
TheCommission = 7.5
Case Is >= 30
TheCommission = 10
Case Else ' Other values.
TheCommission = 0
End Select
fCommission = TheCommission
End Function
My question is: can I use a select case scenario to determine the commission
rate with a criteria of either full or partial. If I can, then there would
be two commission rates for each case based on the "FULL" field either being
full or partial. If I've been clear as mud, I coud certainly use the help.
If someone could show me how to write it, I'd be forever gratefull.
my need. I ended up doing so, but there is a small issue I didn't cover. My
original question concerned figuring commissions for sales people. I am
inserting the MVP's suggested code--it worked fine; however, I have a field
in my query called "FULL" that determines whether my sales people earn full
commission or partial commission.
Function fCommission(nCommission As Variant) As Variant
Dim TheCommission As Variant
Select Case nCommission
Case Is < 10
TheCommission = 0
Case 10 To 19.999
TheCommission = 5
Case 20 To 29.999
TheCommission = 7.5
Case Is >= 30
TheCommission = 10
Case Else ' Other values.
TheCommission = 0
End Select
fCommission = TheCommission
End Function
My question is: can I use a select case scenario to determine the commission
rate with a criteria of either full or partial. If I can, then there would
be two commission rates for each case based on the "FULL" field either being
full or partial. If I've been clear as mud, I coud certainly use the help.
If someone could show me how to write it, I'd be forever gratefull.