PDA

View Full Version : Microsoft Query



jmenche
03-02-2006, 04:01 PM
While this may not be a VBA question, I figgered one of you gurus might know how to fix this.

I have a Database Query in one sheet that refers to a named range in another sheet. I changed the parameters of the named range but my query does not reflect the new data when I refresh it. Seems like a link is broken somewhere.

Can anyone help?

Thanks:beerchug:

XLGibbs
03-02-2006, 04:32 PM
I deal with MS Query a lot...

You changed the named range definition that refers to the location of the query, but that does not necessarily change the query itself. You mention parameters....are there parameters assigned as criteria for this query?

Unless you edit the action query using MS Query, the query definition as it were, will not change.

If your query is requesting data from the named range, changing the Refers To: of the named range will not change the actual query, you must actually edit the query itself...

jmenche
03-03-2006, 06:57 AM
XLGibbs,

You hit the nail on the head. By parameters I did mean changing the Refers To: definition of the range name.

However, I have tried to edit the query in Microsoft Query and still do not know how to get it to expand the definition of the range. I have tried to delete the table, readd it, and recreate the query and it still has the old range name definition stored somewhere.

Can you help?

Thanks

XLGibbs
03-03-2006, 02:24 PM
There are two different things you are referring to.

There is a name that Refers To the query itself. By highlighting in the table area where the query is returned you should see the external data indicators, including the edit query option. Once you edit the query, the returned data should be what you specified.

Now, a named range that refers to the resulting table has to be specified separately...

You can insert>name>define
to create a new name that refers to the range of your table.