Solved

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

Posted on 2006-06-13
3
3,698 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need to filter query and have subform updatable 2 26
Access 2016 - Labels prompt to print 4 30
Passing variables to a function 6 34
Should I keep recordsets open? 3 23
This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

785 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