Paste Linked Table

  • Thread starter Thread starter Martin
  • Start date Start date
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
 
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.
 
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.
 
Back
Top