Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I need to find out if a or multiple tables exist (ImportError, ImportError1 etc) and if they do, delete them.
    I cannot seem to find any simple code to do so.
    Help!!

    Thanks,

    itconc

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Something like this should be able to clear tabledefs with ImportErrors in the Title

    Code:
    Function ClearImportErrors()
    
    Dim tdf As DAO.TableDef, strName As String
    
    'Loop Tables and IF ImportErrors in Name then Delete
    
    For Each tdf In CurrentDb.TableDefs
        If InStr(1, tdf.Name, "ImportErrors") <> 0 Then
            strName = tdf.Name
            CurrentDb.TableDefs.Delete strName
        End If
    Next
    
    MsgBox "Import Error TabeDefs Deleted", vbExclamation
    
    End Function
    Andrew

  3. #3
    3 Star Lounger
    Join Date
    Oct 2004
    Location
    Houston, Texas, USA
    Posts
    242
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks, will try asap.
    I appreciate your help.

    itconc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •