Solved

Importing text file into access - deleting first record

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

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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 …
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 …

708 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