Question Name chnage of tables, queries and autom. corresponding change of references to those (1 Viewer)

panchitocarioca

Registered User.
Local time
Today, 01:01
Joined
Aug 11, 2008
Messages
11
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,
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:01
Joined
Jul 9, 2003
Messages
16,271
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.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 09:01
Joined
Sep 12, 2006
Messages
15,635
out of interest, why would the names of objects, etc HAVE to be changed?
 

redneckgeek

New member
Local time
Today, 04:01
Joined
Dec 28, 2007
Messages
464
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...
 

Users who are viewing this thread

Top Bottom