Next year

C

Curmudgeon

We're scheduling tours for next year (2006) by entering, for example,
1/10/06 into a date field. For this year (2005) we can simply enter,
for example, 12/25 and the year autofills to 12/25/05.

Question: is there a property or simple code that will convert a dd/mm
entry into next year IF it is prior to today Date()? Thank you, Access
masters, for any help and for providing a lot of interesting reading
here at this newsgroup.
 
S

Sprinks

Hi, Curmudgeon.

You can use the control's AfterUpdate event procedure to compare the date
entered to the result of the Now() function, which returns the current date.
Then add a year:

If [YourDate] < Now() Then
[YourDate] = DateAdd("yyyy", 1, [YourDate])
End If

Sprinks
 
Top