Just to start with , I am not a very experienced programmer in Access. Is there any way I can disable the import error tables which are auto generated by access when you import files from excel ?
The reason I want to do this is my excel file has about 4000 rows with data about different locations,now the location I have to do the reporting on is importing properly thats why I am not worried about about the import errors . Also, it only detects the error in one row and because I import the table from vba code it will keep generating this error tables and I end up with big bunch of them.
I did some research but I find answer about solving the issue by fixing the file format of import , but I failed to get the answer about how to disable them.
Appreciate if anyone can help.
EDIT :
After suggestion from @parfait following code did the trick. Any other suggestions are also welcome.
Sub dropImportError()
Dim tbl_name As DAO.TableDef, str As String
With CurrentDb
For Each tbl_name In .TableDefs
str = tbl_name.Name
If InStr(str, "ImportErrors") <> 0 Then
str = "DROP TABLE
" & str & ""
DoCmd.RunSQL str
End If
Next
End With
End Sub
Just came across this issue myself, after running the import of procedure I immediately ran the following code which was saved in a stand-alone Module. Simply paste the function
DeleteImportErrors
into the macro, procedure, or function.Module code: