Import text file into Access 2003, skip first 8 rows.
Posted on 2007-10-17
I have a DB that is used to import text files that are produced from a corporate HR system. The issue is that these text files often contain several lines of crap before that data that I want actually starts. I have been manually deleting the header data (crap) for some time now, however, I want to be able to tell access to ignore it on the import and start at a specific line (lets say line 9). Here is the code I have so far:
On Error GoTo ImportError_Err
'Imports Individual Readiness data from PMKeyS Output Text File
'Delete current data set
DoCmd.RunSQL "DELETE tblpmkPersAIRN.* FROM tblpmkPersAIRN;"
'Import new data set
DoCmd.TransferText acImportDelim, "ImportSpec_PMKeyS_AIRN_Data", "tblpmkPersAIRN", DBFilePath & "AIRN.txt", True, ""
Form_frmMenuMain.AIRNBy.Value = Form_frmMenuMain.varCurrentUser
Form_frmMenuMain.AIRNUpdate.Value = Now()
MsgBox "Data Transfer Complete"
Any help would be greatly appreciated.