Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import Excel file into a table in MS Access 2000 using VBA 1

Status
Not open for further replies.

Loui2005

Programmer
Jan 12, 2005
8
US
Hi Guys,

I’d like to import an Excel file into a table in MS Access 2000. I need to keep the same fields name from Excel (Format) into the table. The data in Excel is on Sheet1. I’m having a big problem trying to achieve this process. I’d like to be able to keep the same format in the Access table. This is what I have so far.

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"ORDER TABLE", "C:\ORDER.xls", True, "Sheet1"

Let me know if I need to give you any more info.

Can anyone help me please…!!!!

Thanks so very much, God bless you all.
 
Without prebuilding the table, there isn't a way to guarantee access will correctly interpret the format of each field. It will capture the column headings as the field names though.

The line of code you posted should accomplish exactly what you're asking for. I wouldn't suggest putting a Space in the name of the table though. Call it tblOrder or OrderTable or even ORDER_TABLE.


I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
I’m having a big problem
Any chance you could tell us which problem ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top