Applecore Pages on Microsoft Access

Deleting error tables created when importing data from an external source

If you use an external data source to import data from, there is the possibility that when this is imported into Access, errors might occur, such as the data not fitting into the datatype allocated for the field. As Access creates tables containing these records in a standard format, it is quite easy to delete these if you do not wish for the user to be alerted to their presence:

Sub sDeleteImportErrors()
    Dim db As Database
    Dim intCount As Integer, intPos As Integer
    Set db=CurrentDb
    intCount=db.TableDefs.Count-1
    For intPos=intCount To 1 Step -1
        If Instr(db.TableDefs(intPos).Name,"_ImportErrors")>0 Then
            DoCmd.DeleteObject acTable, db.TableDefs(intPos).Name
        End If
    Next intPos
    Set db=Nothing
End Sub

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 14:01:39