Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Delete tables with a certain string in their name?

Discussion in 'Information Technology' started by Henrootje, Nov 17, 2005.

  1. Henrootje

    Henrootje
    Expand Collapse
    Guest

    I would like to delete all tables in my database that have the string
    '_Importfouten' in their name.


    Any suggestions no how to do this?


    TIA,


    Henro
     
  2. Loading...


  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Function KillTables()
    Dim db As DAO.Database
    Dim tdx As DAO.TableDefs
    Dim i As Integer

    Set db = CurrentDb()
    Set tdx = db.TableDefs

    For i = tdx.Count - 1 To 0 Step -1
    If tdx(i).Name Like "*_Importfouten*" Then
    Debug.Print "Deleting " & tdx(i).Name
    tdx.Delete tdx(i).Name
    End If
    Next
    End Function

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Henrootje" <HenroV@gmail.com> wrote in message
    news:1132151901.363830.119990@o13g2000cwo.googlegroups.com...
    >I would like to delete all tables in my database that have the string
    > '_Importfouten' in their name.
     
  4. Henrootje

    Henrootje
    Expand Collapse
    Guest

    I am very happy with this!

    Tenk joe! Henro
     

Share This Page