Solved Import .CSV VBA Run time Error 3011

sathsaj

Registered User.
Local time
Today, 11:50
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 ?
 
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

Back
Top Bottom