B
bravofoxtrotuk
I have a text box on a small form whose control is a date field in a table.
The format is set to short date, and the input mask is 00/00/00;0;_ as is
the field in the table.
The date is updated by a macro which runs on AfterUpdate event of an options
group (of 5 options) elsewhere on the same form. Dependent on the option
selected, the macro performs a 'DateAdd'. The condition in the macro will
add 1 year to the date, except when just the 4th option is selected, when it
adds 25 years, using this: DateAdd("yyyy",25,Date()). It all works fine
until I set the 4th option.
It's here that it goes a little odd. The date will show 15/11/2030 despite
all my efforts. Then I tried adding 20 years in the DateAdd, and it shows
correctly as 15/11/25 with a 2 digit year! It works correctly as far as
adding 24 years which shows 15/11/29, but as soon as I go past 25, it shows 4
digits 2030 for the year. It does the same if I change the DateAdd to use
Now(). The date gets stored in the underlying table in the same way. My
control panel settings are set to short date UK format. All other date
fields on this and numerous other forms in my database display correctly.
Any ideas? Is this something which occurs to remind me that it's this
century and not last?
The format is set to short date, and the input mask is 00/00/00;0;_ as is
the field in the table.
The date is updated by a macro which runs on AfterUpdate event of an options
group (of 5 options) elsewhere on the same form. Dependent on the option
selected, the macro performs a 'DateAdd'. The condition in the macro will
add 1 year to the date, except when just the 4th option is selected, when it
adds 25 years, using this: DateAdd("yyyy",25,Date()). It all works fine
until I set the 4th option.
It's here that it goes a little odd. The date will show 15/11/2030 despite
all my efforts. Then I tried adding 20 years in the DateAdd, and it shows
correctly as 15/11/25 with a 2 digit year! It works correctly as far as
adding 24 years which shows 15/11/29, but as soon as I go past 25, it shows 4
digits 2030 for the year. It does the same if I change the DateAdd to use
Now(). The date gets stored in the underlying table in the same way. My
control panel settings are set to short date UK format. All other date
fields on this and numerous other forms in my database display correctly.
Any ideas? Is this something which occurs to remind me that it's this
century and not last?