By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,940 Members | 611 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,940 IT Pros & Developers. It's quick & easy.

Import CSV file in Access VBA

P: 46
I'd like to do an import but not sure how to do it with a CSV file.
this would be my line of code when using an xlsx file, but how do i do it with a CSV?
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tbl_stats", "S:\ Go To Sleep\Import Data Code\Actiwatch sample.xlsx", True

Thank you!
Dec 15 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 14,534
DoCmd.TransferText acImportDelim, "<specification name>", "tbl_stats", "S:\ Go To Sleep\Import Data Code\Actiwatch sample.xlsx", True

To get a specification name you must first manually import the file and using the advanced wizard save the specification. Otherwise just leave it blank. The true at the end assumes you have field names in the first line of your csv file. If not change it to false.
Dec 15 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.