-
CSV Import
Hey guys,
just having trouble importing a csv file (bank statement) into an existing table in access, the table is inside a tab control, named tblImport subform1,
this current code i have creates a new table each time and doesn't update, if someone can change the code for me would be appreciated.
Code:
Private Sub cmdImport_Click()
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:="tbl_import", Filename:=strfilename
Else
Exit Sub
End If
End With
End Sub
-
Re: CSV Import
I think you need to create an Import Specification. This http://www.access-programmers.com/cr...cess-2003.aspx shows how to do it.