Because I have scripts setup so I can
check to see if anyone's bday is one
week from now to mail them a card
and tells me who's is today so I can send
them email and you can't do that unless
the year is 2006 or the current year.
Sorry, but what you said is in error. You can calculate what you need from
the birth date, without having to keep the "next birthday."
Try this code in the Immediate Window; I lumped it all together, but for
your application, you may want to separate it into different functions.
Public Function ThisBday(DOB As Date, WithinWeek As Boolean, IsToday As
Boolean)
Dim datThisBday As Date
datThisBday = DateSerial(Year(Date), Month(DOB), Day(DOB))
ThisBday = datThisBday
If DateDiff("d", Date, datThisBday) < 7 And DateDiff( _
"d", Date, datThisBday) > 0 Then
WithinWeek = True
Debug.Print "Within a Week!"
ElseIf DateDiff("d", Date, datThisBday) = 0 Then
IsToday = True
Debug.Print "It's Today!"
End If
End Function
Larry Linson
Microsoft Access MVP