LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Export to Access

Apologies for cross-posting, I'm not sure which forum is better for this
problem.

In an Access database, I have a form that asked for the location of an excel
file, then imports the information from three worksheets in the file into
three existing tables. There's some validation and manipulation that
happens, so I don't use
docmd.transferspreadsheet. Instead, for each worksheet, I make a preset
named range in the worksheet a adodb recordset, loop through the records and
import only the rows I want using docmd.runsql to do an insert statement.

Each sheet contains dates. I've dim-ed a variable of type date for each
date to be imported. My syntax for assigning the values in each case is:
If Not IsNull(rsXL.Fields(7).Value) Then FollowupDate =
CDate(rsXL.Fields(7).Value)

From one sheet, the dates are imported as date serials (eg: FollowupDate is
38414). From the other two sheets the dates are imported as regular dates
(eg: FollowupDate is 2/2/2005). In the excel spreadsheet, the columns
containing dates are all formatted to be date columns.

How can I make Access/Excel view all dates in a consistent manner? The way
the date is formatted affects the insert sql statement.

I'm using Access 2003 and Excel 2003, but may have to do the same with excel
2000 & 97.

Thanks for your help.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access export [email protected] Excel Discussion (Misc queries) 0 February 9th 09 02:16 PM
Export from Access jhrBanker Excel Discussion (Misc queries) 1 August 7th 07 09:06 PM
Export from Access to Excel tamxwell Excel Programming 9 June 30th 05 08:31 PM
Export from Access tamxwell Excel Discussion (Misc queries) 0 June 28th 05 06:41 PM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM


All times are GMT +1. The time now is 01:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"