M
macamarr
Hello, below is my code for some simple math for my form.
If it's works fine, but if there is a better way feel free
to let me know. My question is related to the code. On my
form I have the allotted value, which is on the sub form
and the tblvac. On my tblEmployee's I have the hire date.
What I would like to do is have the Allotted value update
according to the hire date annually.
Example:
After 1 year of service you are allotted 40hrs of
vacation, 2 years 80, 7 years 120 and 15 years 160. So If
I were hired on 1-1-04 the value of course would be 0, but
on 1-1-05 it would become 40. Probably possible but I
don't have a clue.
Private Sub EndDate_LostFocus()
Days_Used.Value = EndDate - StartDate
Hours_Used.Value = DaysUsed.Value * 10 'ten hour shifts
Remaining.Value = Allotted.Value - Hours_Used.Value
End Sub
If it's works fine, but if there is a better way feel free
to let me know. My question is related to the code. On my
form I have the allotted value, which is on the sub form
and the tblvac. On my tblEmployee's I have the hire date.
What I would like to do is have the Allotted value update
according to the hire date annually.
Example:
After 1 year of service you are allotted 40hrs of
vacation, 2 years 80, 7 years 120 and 15 years 160. So If
I were hired on 1-1-04 the value of course would be 0, but
on 1-1-05 it would become 40. Probably possible but I
don't have a clue.
Private Sub EndDate_LostFocus()
Days_Used.Value = EndDate - StartDate
Hours_Used.Value = DaysUsed.Value * 10 'ten hour shifts
Remaining.Value = Allotted.Value - Hours_Used.Value
End Sub