I have an access table where I have to import a csv file.
I have a very simple code in the Click _ Event Sub.
However it seems the code is ok, file gets imported but I get a separate table with errors in import.
In that table two fields are specified as error fileds.
The fields data type is numeric and I have set the filed definition in the table as number for both. I tried saving the problem fileds in the csv file as text and then in design view changed the fileds type to text. That did not work too.
What can I do to prevent a second "error" table to be created and the csv file to get imported in the access table ok ?

Here is my code:

Option Compare Database

Private Sub Command0_Click()
 DoCmd.TransferText acImportDelim, "File Import Specification", "File", "C:\File.csv", 0
End Sub

Thanks in advance

7 Years
Discussion Span
Last Post by boblarson

So you actually created an import specification which is called "File Import Specification?"

Perhaps if you haven't figured it out yet and want to send me your database file and your csv file, I can see what is up.

I can PM you my email address if you wish. Let me know.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.