Hi all,
I developped some VBA code to import a CSV file (semicolon delimited, no header line, no text qualifier markup) into an existing table (named VERIDASS_Imported_File ) in Access db.
My input file has 70 columns, so the existing table. In the existing table, columns are named F1,F2,..., F70 (initally they were named "Field1, Field2,..." but then I got run-time error 2391)
Data are well imported but everything in first column (it didn't considered the semicolon as separator). I'm pretty sure that it is just one small thing that I have to adapt but I don't get it.
You'll find my code here under
Thibaut
I developped some VBA code to import a CSV file (semicolon delimited, no header line, no text qualifier markup) into an existing table (named VERIDASS_Imported_File ) in Access db.
My input file has 70 columns, so the existing table. In the existing table, columns are named F1,F2,..., F70 (initally they were named "Field1, Field2,..." but then I got run-time error 2391)
Data are well imported but everything in first column (it didn't considered the semicolon as separator). I'm pretty sure that it is just one small thing that I have to adapt but I don't get it.
You'll find my code here under
Public Sub ImporterFichier()
' Open Dialog box to select a file
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.Title = "Sélectionner le fichier à importer"
fd.InitialFileName = ""
fd.Filters.Clear
fd.Filters.Add "Fichiers CSV", "*.csv"
fd.Filters.Add "Tous les fichiers", "*.*"
If fd.Show = True Then
' If a file is selected, import it in VERIDASS_Imported_File table, semicolom delimited, no header line, no text markup
DoCmd.TransferText acImportDelim, , "VERIDASS_Imported_File", fd.SelectedItems(1), False, ""
End If
MsgBox "Import Successful!"
End Sub
Thanks in advance for your help and have a nice dayThibaut