Change source for Linked Table (1 Viewer)

ghh3rd

Registered User.
Local time
Today, 23:51
Joined
Feb 11, 2002
Messages
25
I have a linked table and want to change it's data source to another table entirely -- ie: different file name.

Can this be done with linked tables, or can you just link to another file with the same name but in another directory? If linked tables have this limitation, how would you accomplish what I'm trying to do. I want to keep the same name for the linked table.

Ultimately, I want to populate a listbox with the different files in a directory and change tblSource to point at the chosen data source.

Thanks,


Randy
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:51
Joined
Aug 30, 2003
Messages
36,126
After you've linked the new table, you can change it's name to anything you want. It's name in it's original database doesn't change.
 

ghh3rd

Registered User.
Local time
Today, 23:51
Joined
Feb 11, 2002
Messages
25
True, but I'm trying to keep the same table name (tblSource) for the linked table, but change it's source from, let's say, from file1.txt to file2.txt.

Thanks,


Randy
 

Moniker

VBA Pro
Local time
Today, 17:51
Joined
Dec 21, 2006
Messages
1,567
Right-click the linked table, and select "Linked Table Manager" and you can change the linked file to whatever you want. You can do this programmatically as well, but get that down first.

Straight from MS Access Help:

To change the path for a set of linked tables:

1) Open the database that contains links to tables.
2) On the Tools menu, point to Database Utilities, and then click Linked Table Manager.
3) Select the Always prompt for new location check box.
4) Select the check box for the tables whose links you want to change, and then click OK.
5) In the Select New Location of <table name> dialog box, specify the new location, click Open, and then click OK.
 

Users who are viewing this thread

Top Bottom