I saw your response to khagen who wanted to import a lot of text files. I then attempted to apply the code. As you suggested, I removed the If..EndIf section, since I am importing all files using one spec into the same table (from a floppy).
When I click my import button, I get the message "compile error: variable not defined". After clicking "ok", Access highlights "Set db" of the "Set db = CurrentDb" line below.
Private Sub Import_CurrEval_Text_Files_Click()
Dim strFile As String
Dim strDirectory As String
Dim strTable As String
Set db = CurrentDb
Do While strFile <> ""
strTable = "tblCurrEval"
DoCmd.TransferText acImportDelim, strTable, "a:\" & strFile
Str File = Dir
MsgBox "The import is complete.", vbInformation, "Import Finished"
I would appreciate any suggestion you could make.