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
Solved

Importing text file into access - deleting first record

Posted on 2014-01-27
3
960 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
3 Comments
 
LVL 35

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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 …

837 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