When I am trying to import a .csv into a table in access somehow it is wanting to match my columns not by name but by F1-F41 or the excel sheet. How can I get it to only match on column names that are defined in the excel sheet on the first row? This is a .csv file I am trying to import.
So right now I am just having excel create it's own table so I can see how it is importing.
So right now I am just having excel create it's own table so I can see how it is importing.
Code:
Dim strfilename As String
With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select the CSV file to import"
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "CSV Files", "*.csv", 1
.Filters.Add "All Files", "*.*", 2
If .Show = -1 Then
strfilename = .SelectedItems(1)
DoCmd.TransferText TransferType:=acImportDelim, _
tableName:=acTable, filename:=strfilename
Else
Exit Sub
End If
End With
Exit Sub
Comment