Increase data in box one number with command button

C

Curtis Stevens

I have a comman button with on click event of:

Me.Principal_Bday1 = Me.Principal_Bday1 + 1

But I want their bday to increase by 1 year, so it reminds me again next
year, like 7/25/06 becomes 7/25/07

Thanks
Curtis
 
F

fredg

I have a comman button with on click event of:

Me.Principal_Bday1 = Me.Principal_Bday1 + 1

But I want their bday to increase by 1 year, so it reminds me again next
year, like 7/25/06 becomes 7/25/07

Thanks
Curtis

Why?
Only the individual's DateOfBirth should be stored in your table. Then
it's a very simple matter to find all persons whose DateOfBirth is in
any particular month.

Select TableName.* from TableName Where Month([DateOfBirth]) = [Enter
the month wanted] Order By Format([DateOfBirth],"mm/dd");
 
C

Curtis Stevens

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.
 
L

Larry Linson

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
 
Top