Public Function ExportTables()
Dim db As Database
Dim rs As Recordset
Dim sSQL As String
sSQL = "select SourceTableName, TargetTableName, DatabaseName from tblTableExport"
Set db = CurrentDb()
Set rs = db.OpenRecordset(sSQL)
Do While Not rs.EOF
DoCmd.TransferDatabase transfertype:=acExport, _
databasetype:="Microsoft Access", _
databasename:=rs.Fields(2).Value, _
ObjectType:=acTable, Source:=rs.Fields(0).Value, _
Destination:=rs.Fields(1).Value, structureonly:=False
rs.MoveNext
Loop
End Function
|