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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am trying to import an Excel file

Status
Not open for further replies.

mamidu

MIS
Sep 23, 2002
1
FR
I am trying to import an Excel file into an Access database. Some of the fields in the Excel file are formatted as numbers. Without changing any formats in the Excel file, how would I import all the data as text fields into Access?

Thanks for your help!
 
There isn't much 'help' in the Help file. My understanding is that you must either change the data type once it is imported or insert the ' character before the values in Excel prior to importing (but then you wont be able to perform calculations on them in Excel).
 
Hi mamidu

Dont think you have to go that far:

I know this doesn't work for a manual import from excel (cant change data type) but there are workarounds.

First try DoCmd.TransferSpreadsheet - where you are importing into a specific table. This should work just fine - as long as all the field names match.

Otherwise you can always import into a temp table and then use queries to get the information where you want and in whatever form you want.

Stew

 
mamidu,
I just learned this myself. I was cursing access left and right. If you can save it as a text file, do that. Then just import as normal. Then you can change the formats on each column.
Lori
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top