'/assuming you've stored your tablenames in a local table, just open
'/a recordset, then move through that recordset:
dim dbs As DAO.Database
dim tdf As DAO.TableDef
Set dbs = CurrentDB
Do Until rst.EOF
On Error Resume Next
dbs.TableDefs.Delete rst("strTableName")
dbs.TableDefs.Refresh
Err.Clear
Set tdf = dbs.CreateTableDef(rst("strTableName"))
tdf.SourceTableName = rst("strSourceTable")
tdf.Connect = ";DATABASE=" & rst("strSourceDatabase")
dbs.TableDefs.Append tdf
dbs.TableDefs.Refresh
Loop
|