Hi Bob,
I saved this very well, it is from NAK who was active here some time ago and
we had fun when he was making it, because somebody was asking how to get the
last day of the week, but than it became the month. It is maybe not your
question, but I have saved it so long that I send it and maybe you can use
it.
)
The following function will tell you if it is currently the last
"monday,tuesday,wednesday.." of the month. For example. if you pass it
Saturday today (30 August 2003) it will return True.
\\\
'Made by Nick Paterman
Public Function isLastDayOfMonth(ByVal iDay As DayOfWeek) As Boolean
If (Date.Now.DayOfWeek = iDay) Then
If (Date.Now.Day < Date.DaysInMonth(Now.Year, Now.Month)) Then
Dim pIntDaysLeft As Integer = Date.DaysInMonth(Now.Year,
Now.Month) - Date.Now.Day
Return (pIntDaysLeft < 7)
Else
'IS THE LAST DAY OF THE MONTH!
Return (True)
End If
Else
'THAT ISNT TODAYS DAY
Return (False)
End If
End Function
///
I hope this helps a little bit?
Cor