PC Review


Reply
Thread Tools Rate Thread

Importing spreadsheets in Access 2000

 
 
Del
Guest
Posts: n/a
 
      9th Jul 2008
I am using TransferSpreadsheet method to import Excel files into Access 2000.
I want to use the data in the first record as the field names but one of the
fields has a dash in it. When I set hasfieldnames = true all it does is
delete the first record and the field names remain F1, F2, etc. How can I
get around this? I have no control over the names assigned in the
spreadsheet columns and I don't want my users to have to open the spreadsheet
and make changes before they import it.

The code I'm using is:
DoCmd.TransferSpreadsheet , , Me.txtExcelTableName, Me.txtImportPath,
intFieldName
--
Thank you,
Del
 
Reply With Quote
 
 
 
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      10th Jul 2008
On Jul 9, 4:09*pm, Del <D...@discussions.microsoft.com> wrote:
> I am using TransferSpreadsheet method to import Excel files into Access 2000.
> *I want to use the data in the first record as the field names but one of the
> fields has a dash in it. *When I set hasfieldnames = true all it doesis
> delete the first record and the field names remain F1, F2, etc. *How can I
> get around this? *I have no control over the names assigned in the
> spreadsheet columns and I don't want my users to have to open the spreadsheet
> and make changes before they import it.
>
> The code I'm using is:
> * DoCmd.TransferSpreadsheet , , Me.txtExcelTableName, Me.txtImportPath,
> intFieldName
> --
> Thank you,
> Del


Create the destination table first. Then create an import
specification by running an import manually the first time. Save the
Spec with a name. Then you can use it in the future
TransferSpreadsheet commands.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Excel Spreadsheets into Access 2000 Londa Microsoft Access External Data 1 18th Apr 2008 11:29 PM
Importing Excel Spreadsheets into Access Ultsun1 Microsoft Access 2 3rd Oct 2007 02:10 AM
Importing Excel Spreadsheets into Access Ultsun1 Microsoft Access Form Coding 1 2nd Oct 2007 03:41 PM
Importing Excel Spreadsheets into Access Ultsun1 Microsoft Access 0 1st Oct 2007 06:47 PM
Re: Importing excel spreadsheets into Access Ken Snell [MVP] Microsoft Access External Data 0 20th Sep 2004 06:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:27 PM.