I have a bit of real simple VBA that is raising an error that I can't figure out. The purpose of the procedure is simply to import (via saved imports that append to existing tables) dependant upon the first six letter of the file name. The folder containing the files is passed in as an argument to the procedure which is called from another procedure that saves the files from email attachments. Here is the Sub that raises the error:
Public Sub ImportTextFiles(strFolder As String)
Dim strFile As String
Dim strShort As String
strFile = Dir(strFolder)
strShort = Left(strFile, 6)
While strFile <> ""
Select Case strShort
Kill strFolder & strFile
Debug.Print "Killed " & strFile
The error is: Run-time error '3709': The search key was not found in any record.
When the error occurs the first line containing the RunSavedImportExport command is highlighted.
I am running Windows 7 with Access 2010 and this is a .accdb file of only 11.7Mb
I have tried C & R
The names of the only files in the folder are: