I am devloping developing a payroll program.
I want the program to compute Year to Date (YTD) values for Salary, Allowances, Dedections, Tax, Net Pay. I have tried very many times to write the code but could not succeed.
Below is what I did but it is not working:
Option Explicit
Dim ConSalary As Currency
Dim RentAllow As Currency
Dim GrossPay As Currency
Dim YTDConSalary As Currency
Dim YTDRentAllow As Currency
Dim YTDGrossPay As Currency
Private Sub txtConSalary_Change()
txtGrossPay.Text = Val(txtConSalary.Text) + Val(txtRentAllow.Text)
YTDConSalary = YTDConSalary + ConSalary
End Sub
Private Sub txtRentAllow_Change()
txtGrossPay.Text = Val(txtConSalary.Text) + Val(txtRentAllow.Text)
YTDRentAllow = YTDRentAllow + RentAllow
End Sub
Kindly help me out.
Thank you.
Akinyemi