Public Function SpecificWeekDay (d As Date, _
Optional Byval WhatDay As Byte = _
vbSaturday, Optional ByVal GetNext _
As Boolean = True) As Date
Dim iAdd As Integer
iAdd = (WhatDay - WeekDay(d))
If GetNext Then
SpecificWeekDay = DateAdd("d", Iif( _
iAdd >=0, iAdd, 7 + iAdd), d)
Else
SpecificWeekDay = DateAdd("d"m Iif( _
iAdd <= 0, iAdd, iAdd -7), d)
End If
End Function