Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-13-2008, 09:42 AM   #1
panchitocarioca
Registered User
 
Join Date: Aug 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
panchitocarioca is on a distinguished road
Question Name chnage of tables, queries and autom. corresponding change of references to those

dear all,

i have a databse with a relatively large number of tables, queries, forms and reports as well as a significant amount of vba code and expressions. Now, the name of a number of the tables, queries, forms and reports has to be changed. However, the references to those in the queries, forms, reports, vba code and expressions should also be changed accordingly, otherwise the database does not work anymore. Does anyone know if change in the references can be done automatically or relatively easy without having to go through the entire database to check and change each and every reference/item.

many thanks in advance for the help.

best regards,

panchitocarioca is offline   Reply With Quote
Old 09-13-2008, 01:14 PM   #2
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,541
Thanks: 599
Thanked 1,008 Times in 950 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Name chnage of tables, queries and autom. corresponding change of references to t

Some versions of MS Access will change some of the names automatically. However the operative word here is "some" so Before you do anything, make sure you have backed up your database.

I think the facility is called the "automatic update" it's an options setting and you will need it switched on, most people switch it off because it can cause problems.

Regarding your VBA code, again later versions of MS Access have some excellent find and replace facilities, being able to replace words in code throughout your database if necessary.

The problem areas are code within queries, I think you would have to change references to forms within a query manually.
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|  
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 09-14-2008, 01:36 AM   #3
gemma-the-husky
Super Moderator
 
gemma-the-husky's Avatar
 
Join Date: Sep 2006
Location: UK
Posts: 13,843
Thanks: 56
Thanked 1,046 Times in 1,008 Posts
gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all gemma-the-husky is a name known to all
Re: Name chnage of tables, queries and autom. corresponding change of references to t

out of interest, why would the names of objects, etc HAVE to be changed?

gemma-the-husky is offline   Reply With Quote
Old 09-14-2008, 04:23 AM   #4
redneckgeek
Registered User
 
Join Date: Dec 2007
Location: SE Michigan USA
Posts: 464
Thanks: 0
Thanked 1 Time in 1 Post
redneckgeek is on a distinguished road
Re: Name chnage of tables, queries and autom. corresponding change of references to t

Fixing your code is easy. Just use Find & Replace (ctrl + H), and apply to the Current Project.

For the queries, you'll could write some VBA to loop through all the querydefs in the database. For each one, search the SQL property of the querydef for your tablename - and replace it.

If you have a lot of comboboxes on a lot forms, you'd have to do something similar for the forms. Loop through each controal on each form...

redneckgeek is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 12:32 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World