Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting "ImportErrors" table created during Excel file import

Status
Not open for further replies.

SQSunshine

Technical User
Jan 25, 2007
5
0
0
US
My code imports an Excel file when the user clicks on an "Import" button. This works great, except that a "import errors" table is automatically created by Access during the process. Does anyone know what code I can use to delete the table that is created? I have used the DeleteObject method to delete tables that I have created; however, the same code doesn't work on the "import errors" tables. Thanks for any help you can give me.

Susan :)
 


Hi,

You're not at all concerned about the missing data?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Assuming Skips question doesnt concern you

Code:
    DoCmd.SetWarnings False
    Dim tbl As AccessObject

    For Each tbl In CurrentData.AllTables
        If tbl.Name Like "*_ImportError*" Then
            DoCmd.DeleteObject acTable, tbl.Name
        End If
    Next tbl
    DoCmd.SetWarnings True

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work
 
To answer Skip's question...no, in this particular case, missing data doesn't concern me. I tried your code, MaZeWorX...it worked beautifully!!! I can't thank you enough!

Susan :)
 


I guess that Florida sunshine, makes all the problems melt into orange juice.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top