I'm using Access 2007. Most of the times when I import a file at my company, I get an error message because the item description is too long and it creates a table. I found the topic below on how to delete the error tables in a macro, however I can't get it to work. Here's my code:
Code:
Application.DisplayAlerts = False
Function DeleteImportErrTables()
Dim z As Integer
Dim db As DAO.Database
Set db = CurrentDb
For z = db.TableDefs.Count - 1 To 0 Step -1
If InStr(1, db.TableDefs(z).Name, "ImportError") > 0 Then
DoCmd.DeleteObject acTable, db.TableDefs(z).Name
End If
Next z
End Function
The error that I get says "Error Number 2950. Condition True, Arguments: DeleteImportErrTables()"
Any ideas on how to fix this? Thanks!
Prior Topic:
https://www.accessforums.net/program...les-14474.html