Import button issue in the form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to automate system.
I have button 'Import Excel'.
Here is my code behind the button:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel4,
"tblImportData", "C:\Data.xls", True

When I click on Command button, i get this message error:

"Field 'Name' doesn't exist in destination table 'tblImportData' ."

But I do have a field name in this table.

Please tell me What is wrong with this code or tell me any other way to do it.

Thank you so much.
 
Very likely the problem is that you are using an Access reserved keyword
(Name) as a table field name (the latter use of the word is indeed what
Name is, a property to an object!). This tends to create this kind of
problem, Access not being able to distinguish an object (field in this
case) from a property.

Try changing the field name to something else (both sides, access table
and spreadsheet) and try again.

HTH,
Nikos
 
I did change field name and I stil have same error.
I did even try to import from "File-Get External Data-Import", I unable
import the excel file.
??????????
 
I had extra space, now is working.

Thank you

GGill said:
I did change field name and I stil have same error.
I did even try to import from "File-Get External Data-Import", I unable
import the excel file.
??????????
 
Back
Top