Hi There
Hope You Are Good
in code below i need to add ElseIf to exception the missing days:
Hope You Are Good
in code below i need to add ElseIf to exception the missing days:
Code:
Function HolDateType(EmpNumF As Integer, d1 As Date) As String
'On Error Resume Next
If OutOfDate = True Then Exit Function
Dim rst As DAO.Recordset, SQL As String
Dim d2 As Date
d2 = d1
If (Weekday(d1) = 6) Then
HolDateType = WeekEnd
ElseIf (Weekday(d1) = 7) Then HolDateType = WeekEnd
'''[SIZE=4][COLOR=Red] I need ElseIf her [/COLOR][/SIZE]
End If
SQL = "SELECT * FROM MonthRep WHERE InputDate<=# " & Format(d2, "yyyy/mm/dd") & " # AND Id=" & EmpNumF
Set rst = CurrentDb.OpenRecordset(SQL)
If rst.RecordCount > 0 Then
For i = 1 To 31
rst.FindFirst "InputDate=#" & Format(d2, "yyyy/mm/dd") & "#"
If Not rst.NoMatch Then
HolDateType = rst!InputText
End If
Next i
End If