R
ReportSmith
I've looked at several posts, but can't seem to get exactly what I need.
I would like to delete any "*ImportErrors*" table that may get created after
a file is imported (doesn't matter what file type, etc). My thinking is to
search for any table object that ends with "ImportErrors" and try a
DeleteObject statement.
Currently, I have...
Dim dbCurr As DAO.Database
Dim intLoop As Integer
............
Set dbCurr = CurrentDb()
For intLoop = (dbCurr.TableDefs.Count - 1) To 0 Step -1
If Right(dbCurr.TableDefs(intLoop), 13) = "_ImportErrors" Then
dbCurr.TableDefs.Delete dbCurr.TableDefs(intLoop).Name
End If
Next intLoop
.............
I copied code from some other posts to get the one above. I also tried
(without success): DoCmd.DeleteObject dbCurr.TableDefs(intLoop).Name
Can anyone assist with the syntax?
Thanks in advance.
I would like to delete any "*ImportErrors*" table that may get created after
a file is imported (doesn't matter what file type, etc). My thinking is to
search for any table object that ends with "ImportErrors" and try a
DeleteObject statement.
Currently, I have...
Dim dbCurr As DAO.Database
Dim intLoop As Integer
............
Set dbCurr = CurrentDb()
For intLoop = (dbCurr.TableDefs.Count - 1) To 0 Step -1
If Right(dbCurr.TableDefs(intLoop), 13) = "_ImportErrors" Then
dbCurr.TableDefs.Delete dbCurr.TableDefs(intLoop).Name
End If
Next intLoop
.............
I copied code from some other posts to get the one above. I also tried
(without success): DoCmd.DeleteObject dbCurr.TableDefs(intLoop).Name
Can anyone assist with the syntax?
Thanks in advance.