The following function will accomplish what you want but it does not include
any error handling:
Function fImportAllFiles()
Dim strfile As String
Dim strPath As String
'File path '
strPath = "YOUR FILE PATH HERE"
'Change the default directory to the file path
'
ChDir strPath
'Find the firsttext file
'
strfile = Dir("*.txt")
'Loop through the string & import the files
'
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, , "TableName", strPath & "\" &
strfile
'delete the file (consider moving it to an Archive folder instead.)
'Kill strPath & "/" & strfile
'Call Dir to get the next file
'
strfile = Dir
Loop
End Function
Also, look up the TransferText method in the MS help file as there are
several options you may need.