K
Kevin
I need to build a macro. What I need it to do is delete
the ImportErrors tables that are created in my database
during the import of about 50 files. I can do it through
the normal method of DeleteObject-->Tables--
My question is...is there a wildcard that I could use to
delete all the ImportErrors tables? Or is there something
else I could do?
I have tried building a module like this...
Option Explicit
Function DeleteImportErrors()
Dim db As Database, t As TableDef, i As Integer
Set db = CurrentDb()
For i = db.TableDefs.Count - 1 To 0 Step -1
Set t = db.TableDefs(i)
If t.Name Like "*ImportErrors" Then
db.TableDefs.Delete t.Name
End If
Next i
db.Close
End Function
....however I am not sure how to incoporate this into a
button on a form. I am not even sure if this will work
how I want it too.
Please help???
the ImportErrors tables that are created in my database
during the import of about 50 files. I can do it through
the normal method of DeleteObject-->Tables--
files, and I would have to do this for those 50 files.File1_ImportErrors, but like I said there is about 50
My question is...is there a wildcard that I could use to
delete all the ImportErrors tables? Or is there something
else I could do?
I have tried building a module like this...
Option Explicit
Function DeleteImportErrors()
Dim db As Database, t As TableDef, i As Integer
Set db = CurrentDb()
For i = db.TableDefs.Count - 1 To 0 Step -1
Set t = db.TableDefs(i)
If t.Name Like "*ImportErrors" Then
db.TableDefs.Delete t.Name
End If
Next i
db.Close
End Function
....however I am not sure how to incoporate this into a
button on a form. I am not even sure if this will work
how I want it too.
Please help???