Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why is mystery date (12/29/1899) appearing in my table? 1

Status
Not open for further replies.

NattyP

MIS
Sep 1, 2001
45
JM
Has anybody ever experienced or seen this before.

I have a date field which I set to the current date when the record is being saved for the first time.

The field is set to Date/Time type and the format is 'General Date'.

The code which assigns the value is :..

Screen.ActiveForm!DateCreated = Format(Now(), "General Date").

Yet for a few records I see the value '12/29/1899'.

What is going on?
 
Somewhere along the way the date was assigned a -1, which will display as "12/29/1899". One way it could have happened is that the date was set equal to TRUE which in Access is a minus 1. The must be a problem in your code where the date is getting overlayed with the invalid value. Do you have other people writting code besides yourself that may have updated the date field incorrectly. Check your application any place the date field is referenced/updated and you should find the problem.
 
Thanks for that quick response! Since I am the only one writing the code, I will check it as you have suggested.

Regards,
 
I was thinking...If the problem is with the code, why would it affect only a few records and not all
 
That is exactly why I believe it is in the code someplace. If nothing is entered into the date then it should display as null. If the date had 0 then it would display as "12:00 AM" It is unlikely that a -1 would end up in the date field unless it was put into the date somehow. Can you identify by some other data in the record when/where/who put in the records with the odd dates. Somehow the date field was set to -1. For instance yourdate = TRUE. This could happen if you forgot an IF. Like If yourdate = TRUE then. Forgetting the IF would make the date "12/29/1899", as I mentioned, TRUE is a -1 in Access. This is just one possibility there are probably other ways it could happen.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top