I'm trying to add a spreadsheet from a folder using wildcards by just looking for a number in the file name.
strPath = "C:\Training\"
strFile = strPath & "*" + "(ZZ131008)" + "*.xls"
DoCmd.TransferSpreadsheet acImport, , "Training1", strFile, , ""
I get a response saying it cannot find the file and it shows the * in the path it cannot find. How can I make it find the right file?
There are more files in the folder and the (ZZ131008) defines that course, I'd like to reuse the code for the other courses too.
strPath = "C:\Training\"
strFile = strPath & "*" + "(ZZ131008)" + "*.xls"
DoCmd.TransferSpreadsheet acImport, , "Training1", strFile, , ""
I get a response saying it cannot find the file and it shows the * in the path it cannot find. How can I make it find the right file?
There are more files in the folder and the (ZZ131008) defines that course, I'd like to reuse the code for the other courses too.