Solved

Importing text file into access - deleting first record

Posted on 2014-01-27
3
989 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

729 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