Rename linked tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How would you write a macro to loop through all the linked table names
and strip off the schema prefix (e.g. strip off the "dbo_" prefix) ?
 
I don't believe you can do it using a Macro, but it's pretty simple with
VBA:

Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef

Set dbCurr = CurrentDb()
For Each tdfCurr In dbCurr.TableDefs
If Left$(tdfCurr.Name, 4) = "dbo_" Then
tdfCurr.Name = Mid$(tdfCurr.Name, 5)
End If
Next tdfCurr
 
Back
Top