Import Routine Drops First Row/Record from text file.

D

DB_Guy11

I use several import routines on several databases, but lately I've noticed
that I'm losing the very first record/row when I use the import routines. If
I manually import the text file into a table using the same Spec used in the
import routine I get all of my records. The quick fix I'm using right now is
to go into each text file and add an blank space to the top row, but this is
becoming a bit tedious since there are so many. My guess is that the routine
is reading the first row as a header row and none of my text files have
header rows. Is there a way I can make my import routine pick up the first
record/row or do I have to chang my Import Spec and if so how? Below is one
of my import routines, if someone could just show what changes need to be
made I would highly appreciate it. Thanks in advance.
Option Compare Database

Function btnImportAllTAFTC()
Dim strfile As String

ChDir ("c:\TA FTC")
strfile = Dir("*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportFixed, "FTC", _
"TA FTC", "c:\TA FTC\" & strfile, True
Kill "c:\TA FTC\" & strfile
strfile = Dir
Loop

End Function
 
A

Allen Browne

Change your last argument for TransferText to False.

The True indicates you want the first line treated as field names.
 
D

DB_Guy11

Thanks,
I'm sure thats all i needed.

Allen Browne said:
Change your last argument for TransferText to False.

The True indicates you want the first line treated as field names.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top