View Single Post
  #3 (permalink)  
Old 10-21-2007, 11:46 AM
mikan mikan is offline
Novice
Join Date: Oct 2007
Posts: 3
iTrader: (0)
mikan is on a distinguished road
Edit oct 22: !! Oh right, will fix the variable name and return from the function. Hmm..
Will update post with future problem once that's figured out.
~~~~
Ok, thanks. What I aim to do is take the variable of the input box and pass it down a procedure.
Somehow the value isn't being processed through to the calculation.

These are some pieces:
Quote:
Public Class Form1

Private Sub btnCalTax_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalTax.Click
Dim income As Double

GetData(income)
FedIncomeTax(income)
txtTaxable.Text = income
End Sub
Quote:
Sub GetData(ByVal income As Double)
income = CDbl(InputBox("Enter income"))
End Sub
Quote:
Function FedTax(ByRef income As Double) As Double
Select Case income
Case 7150 To 29050
Return 0.15 * (taxableIncome - 7150)

Case 29050 To 70350
Return 0.25 * (taxableIncome - 29050)
End Select

End Function

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!

Last edited by mikan : 10-22-2007 at 05:08 PM. Reason: ~~partial solve
Reply With Quote
The Following User Says Thank You to mikan For This Useful Post:
HelloWorld (10-21-2007)