Import Errors table?

  • Thread starter Thread starter DennisB
  • Start date Start date
D

DennisB

Hi

I have a Access 2003 database that imports data from an Excel workbook.

Periodically an Import Errors table is created (these are minor errors which
can be ignored).

I use a macro to delete any Import Error tables using the deleteobject
command.

This works fine except that if there is no table the macro stops.

Is there anyway I can check for the existence of an Import Errors table and
only run the command if a table exists?

Thanks

Dennis
 
Hi Dennis

I use the following...

-----------------------------------------------------------------------------
Dim db As DAO.Database
Dim tdf As DAO.TableDef

Set db = CurrentDb

For Each tdf In db.TableDefs
If InStr(tdf.Name, "ImportErrors") Then
db.TableDefs.Delete tdf.Name
End If
Next tdf

Set tdf = Nothing
Set db = Nothing
 
Back
Top