Do you see anything wrong with this code? I'm trying to delete all tables that with the Import Errors. Thank you.
Option Compare Database
Public Sub DeleteImportErrorTables()
' Deletes Import Error Tables
Dim tdf As TableDef - IT'S TELLING ME THERE IS AN ISSUE HERE
Dim tblName As String
Dim i As Long
For Each tdf In CurrentDb.TableDefs
tblName = tdf.Name
For i = Len(tblName) To 1 Step -1
If Not (IsNumeric(Mid(tblName, i, 1))) Then Exit For
Next i
If Right(Left(tblName, i), 12) = "ImportErrors" Then
CurrentDb.TableDefs.Delete tdf.Name
End If
Next tdf
End Sub
Option Compare Database
Public Sub DeleteImportErrorTables()
' Deletes Import Error Tables
Dim tdf As TableDef - IT'S TELLING ME THERE IS AN ISSUE HERE
Dim tblName As String
Dim i As Long
For Each tdf In CurrentDb.TableDefs
tblName = tdf.Name
For i = Len(tblName) To 1 Step -1
If Not (IsNumeric(Mid(tblName, i, 1))) Then Exit For
Next i
If Right(Left(tblName, i), 12) = "ImportErrors" Then
CurrentDb.TableDefs.Delete tdf.Name
End If
Next tdf
End Sub