Date is suddenly 1899???????

P

Peter

Hi all, and thanks for all input from all of you. I just modified a record
and received modified date sat 30 Decemeber 1899...how is that possible?

Thanks!
 
K

Keven Denen

Hi all, and thanks for all input from all of you. I just modified a record
and received modified date sat 30 Decemeber 1899...how is that possible?

Thanks!

Can you give any more detail? Are you entering directly into a table?
Are you entering into a form? If it's a form, what code is running
behind the scenes on the events of the control in question and the
form. Lot's of things could be causing an odd date to occur. Dec 30,
1899 is a day before what Access considers day 0 (Dec 31, 1899) so I
assume there's some code interacting with this date somewhere.

Keven Denen
 
K

Keven Denen

Hi all, and thanks for all input from all of you. I just modified a record
and received modified date sat 30 Decemeber 1899...how is that possible?

Thanks!

The significance of 12/30/1899 is that is what Access considers day 0.
You need to give us more information about what you are doing and
where you are doing it? What did you type as the date? If this is
going into a form, what code is running on the events of the form/
control?

Keven
 
S

Sylvain Lafontaine

This is the day 0 and is also considered the "null" day for a datetime value
when only the time part is relevant; so anything that will store only the
time portion into a datetime field will give you back this particular date
for the date part.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
P

Peter

Hi Keven..

i am entering data in a record in a form based on a query... i am using the
following code in the forms before Update Procedure

Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo BeforeUpdate_Err

' Set bound controls to system date and time and current user name.
Me.DateModified = Date
Me.DateMod = Time()
Me.ModifiedBy = Forms![Spider Reports Today].[Operator]

BeforeUpdate_End:
Exit Sub
BeforeUpdate_Err:
MsgBox Err.Description, vbCritical & vbOKOnly, _
"Error Number " & Err.Number & " Occurred"
Resume BeforeUpdate_End
End Sub

Thanks!
 
P

Peter

Hi KenSheridan

thank you, i will try out thi ssolution. Two fields because of me not doing
the right thing...i will follow your advice..thanks


KenSheridan via AccessMonster.com said:
My guess would be that the DateMod control is formatted to show only the date
part of the value, which will, due to Access's implementation of the
date/time data type as a 64 bit number with its origin at 30 December 1899 00:
00:00, show that date. Format the 'time' control as hh:nn:ss to show the
time only.

Another possibility is that DateMod is the name of the field underlying the
DateModified control or vice versa and that you have inadvertently entered it
in the code instead of something like TimeMod in the line to assign the time
modified value. The latter would seem a more logical name in this context.
You'd then be assigning the current time on 30 December 1899 to both.

But why use two field rather than one? There is no such thing as a 'date
value' or 'time value' per se in Access, only a date/time value, so it would
be better to have a single DateTimeMod field and set its value with:

Me.DateTimeMod = Now()

You can fill this new column with all existing value simply by updating the
column to DateModified + DateMod in an update query.

Ken Sheridan
Stafford, England
Hi Keven..

i am entering data in a record in a form based on a query... i am using the
following code in the forms before Update Procedure

Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo BeforeUpdate_Err

' Set bound controls to system date and time and current user name.
Me.DateModified = Date
Me.DateMod = Time()
Me.ModifiedBy = Forms![Spider Reports Today].[Operator]

BeforeUpdate_End:
Exit Sub
BeforeUpdate_Err:
MsgBox Err.Description, vbCritical & vbOKOnly, _
"Error Number " & Err.Number & " Occurred"
Resume BeforeUpdate_End
End Sub

Thanks!
Hi all, and thanks for all input from all of you. I just modified a record
and received modified date sat 30 Decemeber 1899...how is that possible?
[quoted text clipped - 8 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top