Ïåðâûé äåíü òåêóùåãî ìåñÿöà
Me!FirstDay = DateSerial(Year(Now()), Month(Now()), 1)
Ïîñëåäíèé äåíü òåêóùåãî ìåñÿöà
Me!LastDay = DateSerial(Year(Now()), Month(Now()) + 1, 0)
Îïðåäåëåíèå äàò íà÷àëà è êîíöà ïðîøåäøåé íåäåëè
Me!FirstDayOfWeek = Now() - WeekDay(Now(), _ vbUseSystemDayOfWeek) - 6 Me!LastDayOfWeek = Now() - WeekDay(Now(), _ vbUseSystemDayOfWeek)
Ïðîöåäóðà äëÿ ïîäñ÷åòà ðàáî÷èõ äíåé ìåæäó äâóìÿ äàòàìè, íî îíà íå ó÷èòûâàåò ïðàçäíè÷íûå äíè:
Sub SkipWeekend()
Dim DayOfMonth As Date, Counter As Integer
Counter = Me!EndDay + 1 - Me!StartDay DayOfMonth = Me!StartDay
Do While DayOfMonth <= Me!EndDay
Select Case WeekDay(DayOfMonth)
Case vbSaturday, vbSunday Counter = Counter - 1
End Select DayOfMonth = DayOfMonth + 1
Loop Me!CountOfDay = Counter
End Sub