Solved

Runtime-Error ‘2391’: Field 'F1' doesn't exist in destination table

Posted on 2006-06-13
3
3,537 Views
Last Modified: 2008-01-09
I have a table (tbl_RBaze_imp)with column names.  I am trying to import a excel spreadsheet (  ) using the below script.  However, I get the error message;

Runtime-Error ‘2391’: Field 'F1' doesn't exist in destination table 'tbl_RBaze_imp.'

One thing I noticed is that I do not see the "Advance" option when attempting to setup a import specification.  I am using Access2002.  Is there a preference, property or something that will enable this option.  Or maybe it has nothing to do with the error message.

xpath = "C:\Documents and Settings\Bazen.xls"

DoCmd.TransferSpreadsheet acImport, , "tbl_RBaze_imp", xpath, False, bazeexport

Thx
Mahonek
0
Comment
Question by:Mahonek
3 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 16899489
>xpath = "C:\Documents and Settings\Bazen.xls"
I believe this is your problem.  Import Specifications are only for .txt and .csv files, not .xls files.  
You will not be able to create an Import Spec for Excel files.

>Field 'F1' doesn't exist in destination table
Last I remember, if you try to import but do not specify field names, Access will name the fields F1, F2, F3, etc.

>One thing I noticed is that I do not see the "Advance" option when attempting to setup a import specification.
The normal path is File menu, Get External Data, Import..., then choose a Text file in the dialog, hit the Import... button, and the Advanced button appears.  Works on my XP box.

Hope this helps.
-Jim

0
 
LVL 34

Accepted Solution

by:
jefftwilley earned 125 total points
ID: 16902833
Could you make a link table out of the excel spreadsheet, then do a simply update or append query to get the data into your target table?
J
0
 

Expert Comment

by:svetlana20in
ID: 25895271
Rename your target table columns as F1, F2, F3 etc and run the code, It worked for me.
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now