Change Link Table to Local Table With VBA

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

Guest

I have a linked table with SQL Server. I can click Edit, Copy, Paste and get
a choice of whether to create a linked or local table. Is there a way to
accomplish the same thing through VBA ? I found the copy command:

DoCmd.CopyObject , "Customers_bk", acTable, "Customers"

But it does not give the option to change to a local table as in the cut and
paste.
 
You'll need to write code to delete the linked table and import the data
to a new local table.
 
You can use a Create Table query to copy the linked table
to a new local table.

You can create the "Create Table" query in the Query Design
View, and save it.

Then you can run the query from VBA

Or you can look at the SQL view of the query, and use
that to create a New SQL on the fly in VBA.

(david)
 
Back
Top