I am doing a database for vacation time. And we have special circumstances for new hires where they get vacation time but then have to wait until their anniversary date equals the time line to accumulate more vacation. This is the first part of the vacation coding.
Now I am stuck on the special cases. For example: I was hired and received 88 hours but I won't get any more vacation until my anniversary date falls into the greater than 5 years mark. So for the special cases we have a value that equals 4 (special) and then we enter their hours into the text box. Instead of the system figuring it out.
So I am not sure how to write that programming.
Code:
If Me.cat.Value = 1 Then ' Fulltime
lTime = DateDiff("yyyy", Me.annDate.Value, Now())
Select Case lTime
Case Is < 1
If ((monthIn = 1) Or (monthIn = 2)) And (DateDiff("d", Me.annDate.Value, Now) > 180) Then
Me.avHrs.Value = 32
ElseIf ((monthIn = 3) Or (monthIn = 4)) And (DateDiff("d", Me.annDate.Value, Now) > 150) Then
Me.avHrs.Value = 24
ElseIf ((monthIn = 5) Or (monthIn = 6)) And (DateDiff("d", Me.annDate.Value, Now) > 120) Then
Me.avHrs.Value = 16
ElseIf ((monthIn = 7) Or (monthIn = 8)) And (DateDiff("d", Me.annDate.Value, Now) > 90) Then
Me.avHrs.Value = 8
Else
Me.avHrs.Value = 0
End If
Case Is = 1
Me.avHrs.Value = 40
Case Is < 3
Me.avHrs.Value = 40
Case Is < 6
Me.avHrs.Value = 80
Case Is < 10
Me.avHrs.Value = 120
Case Is < 13
Me.avHrs.Value = 128
Case Is < 16
Me.avHrs.Value = 136
Case Is < 19
Me.avHrs.Value = 144
Case Is < 22
Me.avHrs.Value = 152
Case Is > 22
Me.avHrs.Value = 160
End Select
So I am not sure how to write that programming.
Comment