Hello forum,
I have this code and it is not working for me, the error is like "Can not import this table". What can be wrong?
I activate the Sub via form with button
I am a new to access coming from excel so not very experienced user.
Need this to work as I have 400 txt files all with the same structure
Thanks
Code:Sub ImportMultipleFiles() Dim strPathFile As String, strFile As String, strPath As String Dim strTable As String Dim blnHasFieldNames As Boolean ' Change this next line to True if the first row has Field names blnHasFieldNames = True ' Replace C:\Documents\ with the real path to the folder that ' contains the files to import strPath = "C:\UA\Imported\" ' Replace tablename with the real name of the table into which ' the data are to be imported strTable = "UA_Test" strFile = Dir(strPath & "*.txt") Do While Len(strFile) > 0 strPathFile = strPath & strFile DoCmd.TransferText acImportDelim, strTable, _ strPathFile, blnHasFieldNames strFile = Dir() Loop End Sub