|
-
Mar 16th, 2005, 04:25 AM
#1
Thread Starter
Junior Member
Date fields
Hi,
As you can read in this post, I am importing data form Excel into MSAccess through VBA code.
The strange thing is that in MS db the date field is default : 16-4-2005 10:15:25
(Time is not visible in the forms)
In the xls sheet the column with dates has the propertie dd-mm-yyyy
So I changed in MS db the data field to dd-mm-yyyy
But after importing all dates are :30-12-1899
What's wrong ??
-
Mar 16th, 2005, 04:40 AM
#2
Member
Re: Date fields
May be you can try to put a string to catch all the data in excel column and then format it before you export to mdb
Dim strDate As String
strDate = Cells(Row, Column).Value
strDate = Format$(Date, "dd/mm/yyyy")
-
Mar 16th, 2005, 05:35 AM
#3
Thread Starter
Junior Member
Re: Date fields
Hi laisengchew,
Thanks for replying.
Tried it and getting errors that Row isn't defined..
What is the difference with my code ?
VB Code:
With xlsheet
.range("C:C").NumberFormat = "dd-mm-yyyy"
End With
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|