By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,630 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,630 IT Pros & Developers. It's quick & easy.

How to Compute Year to Date (Values)

P: 32
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
Mar 22 '07 #1
Share this Question
Share on Google+
1 Reply


100+
P: 149
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

Could not get excatly what you want. Do you want the YTD values to be maintained independently for the whole program. And you keep on adding the Rentallow and the conSalary to them as required.

thanks
ansuman sahu
Mar 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.