I see 3 problems....
1) there are too many quotes after ".txt" there should only be one
These reports are always formatted the same... XXX then current date.
2) from the code example that runs, it looks like there is a space between the 'xxx' and the date. You are missing the space in the second example.
3) is the date always like this "05-01-2012" or like this "5-1-2012"? The month and day two characters?
Try this:
Code:
Dim FilePath As String
Dim FileDate As String
FileDate = Format(Date, "mm-dd-yyyy")
FilePath = "C:\TroubleList\Atlanta\skb " & FileDate & ".txt"
DoCmd.TransferText acImportFixed, "impTroubleReport", "tblTrouble", FilePath, False
MsgBox "Import Complete for file: '" & Right(FilePath, 18) & "'"
or you can use
Code:
Dim FilePath As String
FilePath = "C:\TroubleList\Atlanta\skb " & Format(Date, "mm-dd-yyyy") & ".txt"
DoCmd.TransferText acImportFixed, "impTroubleReport", "tblTrouble", FilePath, False
MsgBox "Import Complete for file: '" & Right(FilePath, 18) & "'"