Renamed table in query

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

Guest

I receive a new table from an outside source every week. I have many queries
to generate reports and charts. I'd like to take the new table each week and
rename it to have the same name used in the query. So the SQL never has to
change.

But, the queries don't like it. They seem to recognize that even though
this new table has the same name as the table against which the query was
originally written, it is not in fact the same table. When I run the query
against the new table with the old name I get a dialogue box asking for a
parameter.

Is there a way to get the queries to work?
 
Hi,
Not exactly sure why you are having a problem. What parameter is asked
for?

You could do the following:

Create delete query to empty existing table and then when you import new
table, import into existing table.
 
I don't know this but I suspect that problem may be Track Name AutoCorrect.

Try setting
- Track name AutoCorrect should be off
(Tools: Options: General Uncheck all name AutoCorrect features)

After you do that Compact the database, close it, and reopen it.
 
Thank you for your responses. I followed John's advice about the Track Name
AutoCorrect option. But that didn't fix the problem.

To answer Chris, the parameter (and I've had this in other situations) is
simply an "Enter Parameter Value" dialogue box. And the parameter asked for
is just one of the field names. For example,

TABLE1.Date Paid By Co

I don't get this parameter box when the queries are run on the old TABLE1.
But when I get a new table and rename it to TABLE1, the parameter dialogue
box appears when I run the query.

I suppose I could delete the rows in TABLE1 and then append the new rows.
But it's such a kludge. If I don't have to move rows every week I'd be
happier.
 
The only time I've ever seen this is when the Field or Table name is
misspelled or non-existent.

If you drop TABLE1.Date Paid By Co from the query, what happens? Does the
query run or do you get another parameter? If the query runs I would check
out "TABLE1.Date Paid By Co" and see if there are extra spaces or missing
spaces in the name between the two tables.

Just for grins, you might post the SQL statement. Perhaps we can come up
with an alternative way to handle this problem.
 
John,

Thank you for keeping this dialogue going. You have discovered the
problem and I am utterly humiliated. They have changed the column heading
ever so slightly in the tables they are now sending. [Date Paid By Co] is
now [Date Paid By Co#]. I never (obviously) even thought to check. But I
suppose that part of the usefulness of these forums is to help us to think.

Thanks for your patience. I really appreciate it.
 

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