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?
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).
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.
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.