convert all tables to local tables

  • Thread starter Thread starter Luther
  • Start date Start date
L

Luther

Is there a fast way to convert all tables to local tables without doing each
one individually.
 
You mean convert linked tables to local tables? Just import everything into
the backend and you will have all local tables....
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top