Date calculation problems

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I used to be able to type a date in shortest possible form and Access would
translate with no problem -- e.g. typing "12/1/4" upon hitting enter would
change into "12/4/2004." Now it changes into "12/1/2002." Other attempts at
single digit dates produce wierder results.

Also, this little bit of code no longer works:

'to get the next record to start off with the same date as the last entered
DateID_AfterUpdate
Me.DateID.DefaultValue = Me.DateID
End Sub

This sort of thing always worked for me in the past; what gives? Now it
pretends to work, but the default value for the date field is now
"12/30/1899."
 
On Mon, 17 Jan 2005 21:11:02 -0800, "Neal Tipton" <Neal
I used to be able to type a date in shortest possible form and Access would
translate with no problem -- e.g. typing "12/1/4" upon hitting enter would
change into "12/4/2004." Now it changes into "12/1/2002." Other attempts at
single digit dates produce wierder results.

2002? not 2005? Normally if you don't specify the year at all, it uses
the current year; if you do specify the year, IME you need either two
or four digits. Your PC clock is't three years off, is it?
Also, this little bit of code no longer works:

'to get the next record to start off with the same date as the last entered
DateID_AfterUpdate
Me.DateID.DefaultValue = Me.DateID
End Sub

This sort of thing always worked for me in the past; what gives? Now it
pretends to work, but the default value for the date field is now
"12/30/1899."

That date corresponds to 0. What's the datatype of DateID? My guess is
that it's an ID field, not a date, that is, a Long Integer. I suspect
you want to be setting the default value of a different field, not the
(autonumber?) ID.


John W. Vinson[MVP]
 
It certainly was a problem at the beginning! December 1 was being converted
to December 4.
 
Back
Top