Results 1 to 3 of 3

Thread: Date fields

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2005
    Posts
    22

    Arrow 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 ??

  2. #2
    Member
    Join Date
    Dec 2004
    Posts
    39

    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")

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jan 2005
    Posts
    22

    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:
    1. With xlsheet
    2.     .range("C:C").NumberFormat = "dd-mm-yyyy"
    3. 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
  •  



Click Here to Expand Forum to Full Width