I need to import multiple text files into an ACCESS table. All text files have the same format, but are for dfferent years. I have imported the first file (1961) and now wish to import a further 45 files by using a loop in VBA and replacing the year by x.
The file names are:
I have written a smple loop using the transfer text function, however i get the error message 'Run-time error '3051': The Microsoft Jet database engine cannot open the file C:\Program Files\BarBack 6.0\drinks.mdb. It is already opened exclusively by another user or you need permission to view its data'. However, the text file is not open, the acces table is not open, and the databse is no read-only. Please help!
For x = 61 To 99
DoCmd.TransferText acImportDelim, , "Mean_wind", "C:\Documents and Settings\19" & x & "010100-19" & x & "123123_all-vars_219836", Yes