Paste Linked Table

M

Martin

Hi

Is there any way to paste an already linked table as another linked table as
you can do manuualy but programatically?

Thanks
 
M

Marshall Barton

Martin said:
Is there any way to paste an already linked table as another linked table as
you can do manuualy but programatically?


A linked table is just another TableDef object with
something in its Connect property. That means you can use
the DAO CreateTableDef method (see VBA Help) and copy the
properties of the existing linked TableDef. That's
essentially what Access does when you use Copy/Paste in the
Database window.

OTOH, I have to wonder why you would want to do this.
 
D

Dirk Goldgar

Martin said:
Hi

Is there any way to paste an already linked table as another linked table
as
you can do manuualy but programatically?


You mean, make a copy of the linked table, as a linked table with a
different name? You can do this using DoCmd.CopyObject:

DoCmd.CopyObject , "NewLinkedTableName", acTable, "OldLinkedTableName"

Notice that the method's first argument, <DestinationDatabase>, is not
specified, so the copy is made in the current database.
 

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

Top