Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This site is truly a marvel. Without a doubt the most comprehensive, friendly and just plain useful resource of its kind..."

Geography

Where in the world do Tek-Tips members come from?
penndro (TechnicalUser)
20 Jun 12 10:34
I could use some help here with this small function. Checked all of my variable names so I am not sure where the zero in the results are coming from.

Public Function GetTaxTable(TotalComp As Double, TargetComp As Double) As Double

Dim LTIPercent As Integer


Select Case [TotalComp]
Case 100000 To 249999
LTIPercent = 0.07
Case 250000 To 499999
LTIPercent = 0.1
Case 500000 To 749999
LTIPercent = 0.15
Case 750000 To 999999
LTIPercent = 0.25
End Select

If [TotalComp] > [TargetComp] * 1.2 Then

GetTaxTable = LTIPercent * [TotalComp]

Else: GetTaxTable = 0

End If
End Function
SkipVought (Programmer)
20 Jun 12 10:40

hi,

Please post how you call this function.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

SkipVought (Programmer)
20 Jun 12 10:45


BTW, change your declaration to something other than an INTEGRAL data type...

CODE

Dim LTIPercent As Single

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

SkipVought (Programmer)
20 Jun 12 10:58

What if TotalComp is greater than 999999?

Better logic...

CODE

Select Case TotalComp
Case Is >= 750000
LTIPercent = 0.25
Case Is >= 500000
LTIPercent = 0.15
Case Is >= 250000
LTIPercent = 0.1
Case Is >= 100000
LTIPercent = 0.07
Case Else
LTIPercent = 0
End Select

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close