473,498 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Compute Year to Date (Values)

32 New Member
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
1 1353
ansumansahu
149 New Member
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

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

Similar topics

2
23337
by: ITM | last post by:
Does anyone have an example of an SQL query which returns rows for the year-to-date, but where the "year" commences on August 1st? e.g. select * from mytable where datefield > last august 1st ...
2
2498
by: Catherine | last post by:
I am trying to create a report that will give me q total count by month to date, and then another by year to date. Example: Discharges By Type Month To Date Year To Date...
1
2263
by: rock72 | last post by:
I am developing a application using this fields as required by the company. 1. Date Login 2. Time IN 3. Time OUT My question is how to produce the number of days with 1 entry of Date is...
13
20616
by: Huey | last post by:
Hi All, I need to compute the current time value in seconds: the current time is 12/16/2003, and it's time value in integer should around 1071560616 seconds since 1/1/1970. It is easy to get...
2
2016
by: Chad Richardson | last post by:
I would like a single SQL to return all employee's total billable compensation for a year. Their billable rates change throughout the year so under the employee table (one), there is a compensation...
6
4814
by: Burghew | last post by:
Hello, I generate invoices for my customers evry month. I want to keep a form which will allow the user to select the Month and Year through a combo and thus generate reports based on the month...
3
16496
by: jannoergaard | last post by:
Hi I want to write a function that can return a sum for a given date range. The same function should be able to return the sum for the same period year before. Let me give an example: The...
1
4601
by: craigfr | last post by:
I want to create a graph (automatically in a report) which compares the current year's values to the previous years by plotting two lines on one chart. I have one table which has the fields: ...
25
2545
by: rekhasc | last post by:
hi...... Its very urgent.............. how can i take only the year and month part and it should save in the database in the month and year field separately......... when i enter the date in the...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.