The link I provided didn't only address one file. I linked a method to cycle through all files in a folder, and I also linked a method to cycle through all lines in a text file.
Code:
'Declaring variables
Dim objFolder As Folder
Dim objFile As File
Dim strPath As String
dim db as database
dim sfilename as string
dim f
dim fs
dim iRecCt as long
'Specify the path of the folder
set fs = createobject("scripting.filesystemobject")
strPath = "C:\Documents\Darlene"
'Create the object of this folder
Set objFolder = fs.GetFolder(strPath)
'Check if the folder is empty or not
If objFolder.Files.Count = 0 Then
MsgBox "No files were found...", vbExclamation
Exit Sub
Else
set db = currentdb
For each objFile in objFolder.Files
sfilename = objfile.name
ifilesize = objfile.size
dmoddate = objfile.datelastmodified
set f = fs.opentextfile
iRecCt = 1
do while f.atendofstream <> true
irecct=irecct+1
f.readline
loop
f.close
ssql = "INSERT INTO tblData (FileName, FileSize, FileModified, FileRecords) VALUES ('" & sfilename & "', " & ifilesize & ", #" & dmoddate & "#," & iRecCt & ")"
db.execute (ssql)
next objfile
set fs= nothing
set db = nothing
End If
I didn't test this code so there may be some errors, but this assumes you're trying to append the file name, size, the modified date and the number of LINES, NOTE THIS IS DIFFERENT THAN THE NUMBER OF RECORDS IN SOME CASES, to a table called tblData.