Using MS Access/2-digit year conundrum


Hi Scott,

I have a date field with input mask 99/99/00;_ - (format dd/mm/yy-Australian) so users can type 130865 and I can then work out an age from that date.   The problem lies with the 2029 calendar setting ( I think it's .Net 4.5 setting) which I have read about but have no idea how to change.   So, if I type 140830 (14/8/1930) I get age 84.   If however I type in 140829, it returns 14/8/2029, and age -15!

Can you suggest a snippet of code to reverse this trend, so that it converts the date to 1929 and age to 85?

thanks in anticipation

If Me.datecontrol>Date Then
   Me.datecontrol = DateAdd("yyyy",-100,Me.datecontrol)
End If

Since this is a date of birth, the assumption is that the date will be earlier than today. So if it is, it will just subtract 100 years to get the correct date.

Hope this helps,

Using MS Access

All Answers

Answers by Expert:

Ask Experts




I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.


I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Brooklyn College BA

©2017 All rights reserved.

[an error occurred while processing this directive]