convert all tables to local tables

L

Luther

Is there a fast way to convert all tables to local tables without doing each
one individually.
 
M

Maurice

You mean convert linked tables to local tables? Just import everything into
the backend and you will have all local tables....
 
A

aaron.kempf

or you can loop through this with VBA.

I've done it a bunch before

'Rename all the linked tables to have _LINKED at the bottom
For each tdf in CurrentDb.TableDefs
If Right(tdf.name, 7) <> "_LINKED" And Left(tdf.Name <> "Msys")
Then
Docmd.RenameObject etc, etc
End if
Next tdf

'Then run this to append them all locally
For each tdf in CurrentDb.TableDefs
If Right(tdf.name, 7) = "_LINKED" And Left(tdf.Name <> "Msys")
Then
Docmd.Runsql "Select * INTO [" & Replace(tdf.name, "_LINKED",
"") & "] FROM [" & tdf.Name & "]"
End if
Next tdf

HTH- I just usally work with a ridiculously large number of tables; so
I got on the 'automate it' bus a long time ago

-Aaron
 
Top