ACCESS VBA modify the table name

ACCESS VBA modify the table name

Private Sub changetabname_Click()
    Dim tbl As TableDef
    Dim dbs As Database
    I'm nbl As string
    Dim obl As String
    nbl = "Newtable"
    Set dbs = CurrentDb
    For Each tbl In dbs.TableDefs
        obl = tbl.Name
        If obl = "Table1" Then
            tbl.Name = nbl
        MsgBox "modified successfully", vbInformation, "prompt"
        End If
    Next
End Sub

Guess you like

Origin www.cnblogs.com/zhulinvpn/p/12003937.html