hi! im currently creating a payroll system for my project and part of it is a time calculator. but my problem sir is that i don't know how to deduct lates on there daily hour .. its goes this way sir, it has a textbox that has their schedule that is saved on the database and another textbox that contains their monthly rate and its also saved in a database now i created a text box that will contains the number of days in a month so i will just devide the number of days into theirs monthly rate so a can get their daily rate then i created a seven text boxes for a single day. the first txtbox is for the AM IN 2nd is for OUT 3rd is for PM IN 4th is for OUT the 5th is for the result of total hour in the AM and 6th is for the result of total hour in the PM and the 7th is for the total of 5th and 6th textbox and another textbox that will contain the earning for that day but i can only that accurately if i can deduct their lates on their schedule. w/c is their daily is deducted 1.16 per minute of lates and under time. this is the code i used on how will i get their working hour
Dim d1 As DateTime
Dim d2 As DateTime
Dim ts11 As TimeSpan
Dim ts22 As TimeSpan
Dim tsfinal1 As TimeSpan
TextBox9.Text = Val(SalTextBox.Text) / Val(TextBox8.Text)
d1 = DateTime.Parse("1/1/2012 " + Me.TextBox1.Text.Trim)
d2 = DateTime.Parse("1/1/2012 " + Me.TextBox2.Text.Trim)
ts11 = d2 - d1
TextBox5.Text = (ts11.ToString)
d1 = DateTime.Parse("1/1/2012 " + Me.TextBox3.Text.Trim)
d2 = DateTime.Parse("1/1/2012 " + Me.TextBox4.Text.Trim)
ts22 = d2 - d1
TextBox7.Text = (ts22.ToString)
tsFinal1 = ts11 + ts22
TextBox7.Text = tsfinal1.ToString
im actualy trying this code to deduct their lates but i think i will need to do 2000 of line of this before i can finish..
`Inline Code Example Here`If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:00" Then TextBox10.Text = Val(TextBox9.Text)
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:01" Then TextBox10.Text = Val(TextBox9.Text) - 1.16
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:02" Then TextBox10.Text = Val(TextBox9.Text) - 2.32
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:03" Then TextBox10.Text = Val(TextBox9.Text) - 3.48
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:04" Then TextBox10.Text = Val(TextBox9.Text) - 4.64
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:05" Then TextBox10.Text = Val(TextBox9.Text) - 5.8
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:06" Then TextBox10.Text = Val(TextBox9.Text) - 6.96
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:07" Then TextBox10.Text = Val(TextBox9.Text) - 8.12
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:08" Then TextBox10.Text = Val(TextBox9.Text) - 9.12
If TimeValue(SkedTextBox.Text) = "8:00-5:00" And TimeValue(TextBox1.Text) = "8:09" Then TextBox10.Text = Val(TextBox9.Text) - 10.44