Skip first row

S

Scott

I'm importing a CSV file into access using VBA code, now I want to skip the
first row which contains the field names, and start importing from the
second row all the way down till the EOF, how do I do that. ?

Thanks,

Scott
 
H

HSalim

use vba to delete the line
post back if you need the code. I'm feeling too lazy to write it today.
HS
 
S

Scott

If you could please send me the code I would appreciate it.

Here is the code I'm using:

*********

Dim strLine1 As String
Dim strLine2 As String
Dim strLine3 As String
Dim strLine4 As String
Dim strLine5 As String
Dim strLine6 As String
Dim strLine7 As String
Dim strLine8 As String
Dim strLine9 As String
Dim strLine10 As String
Dim strLine11 As String
Dim strLine12 As String
Dim strLine13 As String
Dim strLine14 As String
Dim strLine15 As String

Dim rst As DAO.Recordset
Dim FilesDir As String

Set rst = CurrentDb.OpenRecordset("MyTable")

FilesDir = Dir(Me.FilePath)
Do While FilesDir <> ""
Open Me.FilePath & FilesDir For Input As #1 ' Open file for input.
Do While Not EOF(1) ' Loop until end of file.
Select Case gblSpec

Case 7
Input #1, strLine1, strLine2, strLine3, strLine4, strLine5,
strLine6, strLine7, strLine8, strLine9, strLine10, strLine11, strLine12,
strLine13, strLine14, strLine15
rst.AddNew
rst!MyField1 = Trim(strLine13)
rst!MyField2 = YYYYMMDD_To_Date(Left(strLine2, 8))
rst!MyField3 = Trim(strLine5)
rst!MyField4 = Trim(strLine6)
rst!MyField5 = gblMyVariable .
rst!MyField6 = Date .
rst.Update

End Select

Loop
Close #1

***************************************************

The above code was working good when I had no field header, but now I need
to start importing from the second line that contains the actual data and
not the first line, how do I do that.?

Thanks,

Scott
 
Top