Solved

Importing text file into access - deleting first record

Posted on 2014-01-27
3
981 Views
1 Endorsement
Last Modified: 2016-03-31
Hi Experts,

I have created a program in microsoft access VBA where I import a text file into an already created table in my database.  For some reason every time i import the file it deletes the first record.  

Here is my import specification code
DoCmd.TransferText acImportDelim, "scanner import specification", "scanner", Me.FName, True

Open in new window


My 'scanner import specification' that i have set are not set to skip the first line.  In the preview of the import it shows all the data there, but whenever i import the first line is always missing.  Whenever I add a blank line in my text file it seems to work.

Thanks
1
Comment
Question by:Natspap
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39812490
The "True" at the end of the Import expression says that the file contains column headings.  If it doesn't, then Access would delete the first data line when doing the import.
0
 

Author Closing Comment

by:Natspap
ID: 39812519
Worked perfect after i removed it!  Thank you!
1
 

Expert Comment

by:Treblok
ID: 41530692
Thank you so much. Easy fix. ;-)
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

739 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