Hi Narfla,
If you use short date conventions then you are stuck with that by default,
unless you want to refigure the computer entirely.
An alternative would be to create an event procedure to impose your own
rules for birthdate.
We can safely assume that the birthdate is not a day in the future. We can
make anything newer than 2000 step back a century but what if you hit a date
where you need something between 2001 and Now to appear? If we hardcode the
shift, that isn't going to be an option. There is one alternative - we code
for a special date - 1/1/01 seems a good choice. If you enter 1/1/01 then
we pop up an inputbox and ask you to enter the date in the MM/DD/YYYY (four
digit year) format. Whatever you enter in the input box is what will be
recorded if it is a valid date- even if it makes no sense 12/31/2999 for
example, so the person using the 1/1/01 switch needs to understand how this
works, why it's there, and how it should be used.
Note: this code could flake if the preceding century wasn't a leap year -
this has no effect on your usage because we are keeping 2000 as 2000, but if
someone else uses a similar brute force function to manhandle dates over a
different, longer time span, then they need to deal with the Gregorian
calendar rules. If the century marker (1900,2000,2100) is divisible by 400
(year 200 for instance)), then it's a leap year, otherwise no.
I will call the text box txtBirthDay
We can create and use a function to do this, so that we can reuse the
functionality elsewhere if the occasion arises.
in the after update event - we could do this
Me!txtBirthDay = ShiftDate(me!txtBirthDay)
And then add this function to the form code or a module
Public Function ShiftDate(ByVal d As Date) As Date
Select Case d
Case Is = #1/1/2001#
ShiftDate = InputBox("Enter the Birth Date in MM/DD/YYYY
format", "Birth Date")
Case Is > #1/1/2001#
ShiftDate = CDate(Format(d, "MM/DD/") & "19" & Format(d, "YY"))
Case Else
ShiftDate = d
End Select
End Function
=============================
Or we could embed the code in the afterupdate event of the control this way.
Select Case Me!txtBirthDay
Case Is = #1/1/2001#
Me!txtBirthDay = InputBox("Enter the Birth Date in
MM/DD/YYYY format", "Birth Date")
Case Is > #1/1/2001#
Me!txtBirthDay = CDate(Format(d, "MM/DD/") & "19" &
Format(d, "YY"))
Case Else
'do nothing
End Select
=============================
Hope this helps...
Gordon