Solved Import .CSV VBA Run time Error 3011

sathsaj

Registered User.
Local time
Yesterday, 23:23
Joined
Sep 19, 2017
Messages
24
Dim strFound As String
Dim strSearch As String
strSearch = "C:\Users\SRS\test\STest*.csv"
strFound = Dir(strSearch)
DoCmd.TransferText acImportDelim, "TableSpecs", "Current Day File", strFound, True

Beep
MsgBox "Files Imported", vbOKOnly, ""

what is wrong with this code, first time it works after that it doesnt and gives me Run time error 3011 and when Debug points towards DoCmd line.
Am trying to import a file STest12345685.csv
have saved an import Specs TableSpecs and the table name Iam trying to import is Current Day File.

Could you please help ?
 

Gasman

Enthusiastic Amateur
Local time
Today, 07:23
Joined
Sep 21, 2011
Messages
14,299
And 3011 is? :(
Plus if you know the name of the file, why are you using * in the file path?
 

Users who are viewing this thread

Top Bottom