Hi, There are more than 10 queries in my Access97 database. All of them are based on the same master table. I want to change the table name. It's kind of tedious to change all the queries on by on. Can I use VBA code to do so? Many thanks in advance.
Yes, look into the queryDefs collection, and the queryDef object. A queryDef has a SQL property, which can be changed via code.
On the other hand, things like this come up often. Most developers I know own either speedFerret or Find n Replace (by Rick Fischer). I have the latter. I've used the former. They're both great. They both do global find and replace stuff.
If you really have no money, you'll have to deal with code. But if the money is available, it will save you HOURS AND HOURS OF WORK, and there is no question that you or your boss will recover the cost in the first few months of owning either one.
Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995
Jeremy, thanks for the info. I'll talke to the boss about the utilities you recommended. By the way, I do have a question that're might be easy for you, a question about Access Pivot table: Can the recordsource of a Pivot table be changed? Here is the scenario: I have over 10 queries. I created Pivot1 for query1. Then copied Pivot1 and named as Pivot2. I went to the Pivot2's recordsource and chose query2 as its recordsource. Then I ran the Pivot2 and refreshed the data. The result still contained query1 data.(FYI, All the queries have very similar record layout). Why is that? How does Access recognize the table/query that Pivot table is created on? Or is it a bug in Access97? I've posted this question every Access forum that I can find on the web. Some people said Ms. Access can't change the recordsource. Some said just changed the recordsource. I did, it didn't work. Another question about Pivot table: I add a new field to the table/query. How can I make it part of the Pivot table created on that table/query? Please help. Thanks a bunch.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.