I need assistance transferring all text files (fixed width) into my database. I created this code for excel files and it works great but am unsure how to do it for the text files. Any assistance would be greatly appreciated.
Private Sub Command1_Click()
Dim strPathFile As String, strFile As String, strPath As String
Dim strTable As String, strBrowseMsg As String
Dim blnHasFieldNames As Boolean
blnHasFieldNames = False
strBrowseMsg = "Select the folder that contains the EXCEL files:"
strPath = "C:\Users\IA User 1\Desktop\PRODUCTIVITY"
If strPath = "" Then
MsgBox "No folder was selected.", vbOK, "No Selection"
Exit Sub
End If
strTable = "IMPORT ARCHIVEDATA"
strFile = Dir(strPath & "\*.xls")
Do While Len(strFile) > 0
strPathFile = strPath & "\" & strFile
DoCmd.TransferText acImprotFixed - HERE IS WHERE I TRIED TO CHANGE IT TO NO AVAIL!
strTable , strPathFile, blnHasFieldNames
Kill strPathFile
strFile = Dir()
Loop
End Sub