Hi all, I am new to this VB programming stuff, so far so good, but this last project of the semester has me wanting to pull out my hair, and the textbook is more aggrevating.
I am wanting to pull info, that is typed in a inputbox, and put it in a listbox
sounds simple enough. BUT...
I have a input box that asks for the # of Employees to figure payroll for, and then after you type in the number ,the program proceeds to ask the hourly wage, pay, and all 3 forms of taxes to take out. This all works, the problem... I cant figure how do I take each employee and list each of their pieces of information in a single line per employee
example:
employee# HoursWorked HourlyPay State tax Federal Tax FICA tax NetPay
1 10 10.50 3% 12% 2% $$
2 20 15.25 3% 15% 2.5% $$
thats what I want my listbox to look like, all I can get it to insert is the number 10 if I use the last line of code
ANY SUGGESTIONS are welcome, and appreciated!!
this is what I have that actually works (except for the last line before end sub'........)
Public Class Form1
'Angela
'This program will allow you to figure payroll for employees
Dim strEmployee
Dim intNumEmployees
Dim sngTotal
Dim intCount
Dim strHoursWorked
Dim strHourlyPay
Dim strPercentState
Dim strPercentFederal
Dim strPercentFICA
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
lstPayroll.Items.Clear()
End Sub
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
'This gets the # of employees to figure payroll for
strEmployee = InputBox("How many Employees to figure payroll for? ", "Enter a Value")
intNumEmployees = CInt(strEmployee)
intCount = 0
'Gets the employees information.
Do Until intCount >= intNumEmployees
intCount += 1
strHoursWorked = InputBox("Enter the # of Hours Worked by Employee " & intCount, "Hours Worked")
strHourlyPay = InputBox("Enter the Hourly Amount paid to Employee " & intCount, "Hours Pay")
strPercentState = InputBox("Enter the Percent State Tax to take out " & intCount, "State Percent Withheld")
strPercentFederal = InputBox("Enter the Percent Federal Tax to take out " & intCount, "Federal Percent Withheld")
strPercentFICA = InputBox("Enter the Percent FICA Tax to take out " & intCount, "Fica Percent Withheld")
Loop
lstPayroll.Items.Add(strHoursWorked)
End Sub
End Class