Import Errors table?

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
 
A

Andy Hull

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top