Hi so I inherited this database and while I'm fairly familiar with Access, this is my first experience with VBA. I've got a forum that is supposed to import a CSV file and dump the data into a table. Below is the code. However, after I select the file, it gives me the error above. Any advice? I've tripled checked the headers in the CSV file match the headers in the table. I've rebuilt the database from scratch to ensure it isn't corrupted. I've looked online for tips but nothing it working.
Code:Option Compare DatabasePublic Sub bttnProcessIt_Click() Dim wdShell As Object On Error GoTo ImportIt_Err MsgBox "Remember to save the report file as DATA.csv in the Audits folder", vbOKOnly ' Prompt user for file path for the Raw spreadsheet Application.FileDialog(msoFileDialogOpen).Title = "Please select the audit file for processing" Application.FileDialog(msoFileDialogOpen).InitialFileName = "F:\Audits" Application.FileDialog(msoFileDialogOpen).Filters.Add "Text Files", "*.csv", 1 Application.FileDialog(msoFileDialogOpen).FilterIndex = 1 Application.FileDialog(msoFileDialogOpen).Show strFile_Path = Application.FileDialog(msoFileDialogOpen).SelectedItems.Item(1) DoCmd.SetWarnings (WarningsOff) DoCmd.OpenQuery "qryClear_RawAudit" DoCmd.RunSavedImportExport "Import-Audit" DoCmd.RunSavedImportExport "Export-Audit file" StrResponse = MsgBox("Process Complete! Do you want to open the resulting spreadsheet?", vbYesNo) If StrResponse = 6 Then Set wsShell = CreateObject("WScript.Shell") wsShell.Run Chr(34) & "F:\Audits\Findingsx" & Chr(34), 1, False End If ImportIt_Exit: Exit Sub ImportIt_Err: MsgBox Error$ Resume ImportIt_Exit End Sub