1899 Date

rtdc

Registered User.
Local time
Today, 07:52
Joined
Feb 27, 2007
Messages
55
I got a problem with a date field, in the table it is fine showing ‘04/10/2007’ and the form the same but when I call this field from my code I get ‘30/12/1899’ I’ve looked through the forum and tried the suggestions found and no good.

The table field settings are

Format = Short Date
Required = No
Indexed = No
All others blank.

The code I am using

Dim MANSODTE As Object

Set rs = CurrentDb.OpenRecordset("SELECT * FROM [TempExport]")

Set MANSODTE = rs![EngSignoffDate]

wb_obj.Worksheets(1).Cells((RSB + 10), 1).Value = MANSODTE

This gives me ‘31/12/1899’

If I set it to MANSODTE As Date I get 12:00 AM I have tried the format command which took me back to 1899.

This is really holding me up anyone got an idea?

Cheers.:confused:
 
My guess is that the first record in TempExport.EngSignoffDate is a zero.

???
ken
 
Nice one Ken, spot on that sorted it.

What a silly mistake to make I must be getting old.:D
 
Cool. I thought it may have been something to do with the 'worksheets' line of code in which case I had no clue :eek::D

:)
ken
 

Users who are viewing this thread

Back
Top Bottom