I am trying to create some VBA code that will import delimited data into an Access 2007 database but am having some trouble.
I am trying to use:
DoCmd.TransferText acImportDelim, "Import-Car_Data", Returnvalue, blnHasFieldNames
"Import_Car_data" is a saved import in the database. ( I have used a saved import so that I can specify that the import file is " delimited.)
Returnvalue is a variable that has been populated with the location of the .csv import file by using a combination of the Application.FileDialog(3) and Returnvalue = .selecteditems.Item(1) code.
I continually get an error stating that I "cannot import this file" Run-Time error 31519.
I added some code to change the file extension of the import file from .csv to a .txt but this modification hasn't helped matters.
As my import works fine when called from the GUI rather than through VBA I am very confused.
Does anyone have any ideas on how I can solve tis issue?