Copy a linked table, including descriptions

A

Andrew Gabb

I want to copy a linked table (the link itself not the data) from one DB
to another, and include the field Description text. When I do this
normally (eg cut/paste, import, export), the field descriptions disappear.

Manual is good, but VBA is OK too.

I'm using Access XP, but if necessary I can use a later version to do
the copy.

Andrew
 
A

Andrew Gabb

Andrew said:
I want to copy a linked table (the link itself not the data) from one DB
to another, and include the field Description text. When I do this
normally (eg cut/paste, import, export), the field descriptions disappear.

Manual is good, but VBA is OK too.

I'm using Access XP, but if necessary I can use a later version to do
the copy.

I found one klunky way to do it, but I'd rather a better way.

# Copy the table link to the new DB.

# Open new table link in Design view and delete all except the key
field(s).

# Open old table link in Design view and copy all fields.

# Paste the fields into the new table and save. Ignore the nag.

Andrew
 
B

Banana

Well, given that the default functionality doesn't completely copy, I
suppose we could do it programmmically via VBA.

Pseudo-code:

Dim t As DAO.TableDef
Dim p As DAO.Property

With CurrentDb.TableDefs("SourceTableName")
For Each p in .Properties
t.Properties.Append p
Next
End With

Read the VBA help for correct syntax on appending/modifying a new
property to the Properties collection. You may need logic in place to
add a property if one doesn't exist already. Of course, you also need
CreateTableDef method before going in the loop to create the new table
first.

Hope that gets you someplace.
 

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