# Visual Basic Question/help

**URL:** https://forum.kirupa.com/t/visual-basic-question-help/182229
**Category:** flash
**Created:** [March 16, 2006, 2:50pm UTC](https://forum.kirupa.com/t/visual-basic-question-help/182229 "2006-03-16T14:50:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hey\_suburbia](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@hey\_suburbia](https://forum.kirupa.com/u/hey_suburbia)
#### Post date: [March 16, 2006, 2:50pm UTC](https://forum.kirupa.com/t/visual-basic-question-help/182229/1 "2006-03-16T14:50:47Z")

</div>

I realize I’m not on a VB site, but I’m a long time Kirupa member and you guys are the best at helping out.

Anyway, it’s been a long time since I opened VB and I just needed to make a real simple program. Someone enters their income, then based on their salary, their taxes are displayed.

One input TextBox, one ouput TextBox, and a button to calculate.

I’m almost there, I’m just missing something, I forget the syntax…

I have a TextBox for income:  
txt\_income

I have a TextBox for income + taxes:  
txt\_taxtotal

And a Calculate button:  
btn\_calculate

Here is the code: (I didn’t want to use a class like you did)

```auto
Dim FinalTax As Single

Private Sub btn_calculate_Click()

Dim objCustomer As cCustomer
Set objCustomer = New cCustomer
objCustomer.income = CSng(txt_income.Text)

If income > 0 And income <= 27050 Then
FinalTax = income * 0.15
Else

If income > 27050 And income <= 65550 Then
FinalTax = ((income + 4057.5) * 0.28)
Else

If income > 65550 And income <= 136750 Then
FinalTax = ((income + 14645) * 0.31)
Else

If income > 136750 And income <= 297350 Then
FinalTax = ((income + 36361) * 0.36)
Else

If income > 297350 Then
FinalTax = ((income + 93374) * 0.39)

End If
End If
End If
End If
End If

txt_taxtotal.Caption = Format(objCustomer.FinalTax, "Currency")

End Sub

```

I’m getting a lot of errors, maybe tell me what I’m missing?

Here is the file(s)  
[http://www.basicfunction.com/tax\_calc/tax.zip](http://www.basicfunction.com/tax_calc/tax.zip)

Thanks  
Mickey
