I am trying to error trap for an empty directory when importing a text file, the following code produces: runtime error 3001 Invalid argument, ( the transfer text line is highlighted) Where am I going wrong please?
Function testing() As Long
Dim strFile As String
strFile = "e:\mydir\" & Dir("e:\mydir\*.*"
IF strFile = "" Then
msgBox "No file found"
Exit Function
End if
DoCmd.TransferText acImportDelim, "myspec", "mytbl", strFile
End Function
Function testing() As Long
Dim strFile As String
strFile = "e:\mydir\" & Dir("e:\mydir\*.*"
IF strFile = "" Then
msgBox "No file found"
Exit Function
End if
DoCmd.TransferText acImportDelim, "myspec", "mytbl", strFile
End Function