Can I query where the table name will change?

B

B Nieds

Hi:

At the office we use an inventory system. The system uses dBase files. I
have created my Access database with links to the inventory system and my
sample brings back the data that I want. The problem I am having is that two
of the file names will change. How can I tell Access the name of the file I
want?

Basically I will always work with a group of three files. I use file one to
get a list of files names which have the data I want. These data files
always come in pairs. So I query file one (this file name is always the
same) to get a list of file names and then I want to pass these names to a
query which will retreive the data I want from the files.

Any suggestions?

Thanks
Bill
 
A

Allen Browne

You have an attached table, and you want to point to a different source file
that has exactly the same data structure?

If so, set the Connect property of the TableDef, and remember to
RefreshLink.
 
A

Allen Browne

When do you want to do this?
In code that is called by your AutoExec macro, or the Open event of your
startup form? Or when the user clicks a button to switch data sources?
 
T

toby

Sorry, i just link up an excel data file to the "Access" for using the
function "select from". but i want to change the excel data file frequently
in order to generate same sorts of data from different excel file.
 
A

Allen Browne

If you do not want to do this programmatically, you might be able to use the
Linked Table manager under Tools | Database Utilities.

Alternatively, could delete your linked table, and link again: File | Get
External | Link. Then rename the linked table (in the Database window) if
necessary so that it has the name used in your query.
 
T

toby

i've found the right place.
thanks Allen


Allen Browne said:
If you do not want to do this programmatically, you might be able to use the
Linked Table manager under Tools | Database Utilities.

Alternatively, could delete your linked table, and link again: File | Get
External | Link. Then rename the linked table (in the Database window) if
necessary so that it has the name used in your query.
 
Top