# Field "NoName" doesn't exist in destination table



## yalti

Hello, thanks for reading.

I am trying to setup a macro in Access.

Part of the macros is importing a csv into a table in Access.

I keep on getting this error: 
Field "NoName" doesn't exist in destination table xxxx

The first row in the CSV has the table headings matching.

I was wondering could anyone suggest a solution to this?


----------



## Joe4

Can you copy/paste your entire first row (header row) here?


----------



## yalti

Hi Joe, thanks for your answer.

It's a very simple design, here is the first row:



IDField2trafficround

That's:
ID
Field2
traffic
round

Thanks again.


----------



## Joe4

That is not what a CSV file looks like (don't open it in Excel, that won't give you the true structure of the CSV file).

Can you open the file in a Text Editor (like NotePad), and copy paste the ENTIRE first row?
If should look something like this:


		Rich (BB code):
__


ID,Field2,traffic,round,etc,...


----------



## Joe4

You may want to check to see if you have data past the last column in one of the rows (opening in Excel might be helpful is trying to more easily find that).
If you open the file in Excel, and hit CTRL+END, what cell does it go to?  
Is it past the last column with headers in row 1?


----------



## yalti

Really weird... today I ran the macro in Excel and everything worked perfectly!

I am thinking the issue might be something to do with the input data to the text file:

When the macro worked:
 - Data came from a simple txt file in Notepad

When the macro did not work:
 - Date came from CSV that was not extracted from zip file, just straight opened in Excel...

Here's the first row of the CSV in Notepad, with one line of sample data:

ID,Field2,traffic,round
,000freewebhost.com,44889,NR

I did the CTRL+END and it went to the correct place... though that was the sheet that worked.

Best regards,
 -


----------



## Joe4

yalti said:


> Really weird... today I ran the macro in Excel and everything worked perfectly!
> 
> I am thinking the issue might be something to do with the input data to the text file:
> 
> When the macro worked:
> - Data came from a simple txt file in Notepad
> 
> When the macro did not work:
> - Date came from CSV that was not extracted from zip file, just straight opened in Excel...
> 
> Here's the first row of the CSV in Notepad, with one line of sample data:
> 
> ID,Field2,traffic,round
> ,000freewebhost.com,44889,NR
> 
> I did the CTRL+END and it went to the correct place... though that was the sheet that worked.
> 
> Best regards,
> -


Glad it is working for you now.

If I can offer one piece of advice, you typically never want to open a CSV file in Excel if you want to see what is really there, as Excel will do its own conversions to the data (i.e. drop leading zeroes) and try to "guess" at the data types (and often guesses wrong).  One of my biggest Microsoft pet peeves is that they default Excel to be the default program to open CSV files, which is a horrible idea (because of the aforementioned reasons).

I always recommend opening text files in a text editor like NotePad, if you really want to see what the data really looks like (before Excel conversions).
Upon that default setting is one of the first things I do every time I get a new computer.


----------



## yalti

Hi Joe, I have to run the report again tomorrow ... I will open the CSV file in Wordpad and then copy from there to Excel to run the macro.

Thanks for your advice.


----------

