Re-direct existing query onto another table?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a number of queries that are built upon certain tables.
I have now added a number of updated tables and would like to use the same
queries on them, instead.
So far I have been going into Design View, adding the new table to the grid,
then individually changing the source table in each column of the query, then
finally saving it and removing the old, redundant table.
I do not find this a particularly exciting pastime.
Is there any way of simply re-pointing a whole query at a new table in one
go, or selecting all the columns and changing the source table with one
click, (instead of about 20!).
Thanks for your help
CW
 
CW said:
I have a number of queries that are built upon certain tables.
I have now added a number of updated tables and would like to use the same
queries on them, instead.
So far I have been going into Design View, adding the new table to the grid,
then individually changing the source table in each column of the query, then
finally saving it and removing the old, redundant table.
I do not find this a particularly exciting pastime.
Is there any way of simply re-pointing a whole query at a new table in one
go, or selecting all the columns and changing the source table with one
click, (instead of about 20!).
Thanks for your help
CW

For each query:
1. In Design view: create an alias for the old table.
2. Switch to SQL view.
3. In the FROM clause replace the actual name of the old table with the
new table's name.
4. Save the query.
 
Thanks - I tried that, and unless I'm doing something wrong it doesn't
actually seem any easier, as the table name appears in each field name in the
SQL FROM statement, so it still has to be changed just as many times!
 
It works for me. Perhaps you did not follow the exact step outlined below.

IN Design view (the grid view)
-- Click on the table and set it's alias property to some name
-- SWITCH to SQL view
-- In the FROM clause replace the old table name in the FROM clause with the
new table name
-- SWITCH back to Design view
-- Click on the table and set its alias property to the name of the new
table

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

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

Back
Top