Changing a table name - how to change code

darbid

Registered User.
Local time
Today, 07:28
Joined
Jun 26, 2008
Messages
1,428
I have to change a table name - I should have done it a long time ago but now I have to. For the people who want to know why - I inherited a german MDB with a table named tbl_Tätigkeit and that "ä" will not work on some foreign computers.

I can do a copy and replace for the main code..... but is there a simple way of changing for example the Record Source of a form or any other places where this word my be in the database.
 
Quite a lot of automatic changes happen in Access when a table is renamed. Queries and form designs also change but not entirely. You need to check everything.

Control on forms and reports are frequently a problem. Their properties such as RecordSource, ControlSource, RowSource, Default Value need to be checked and updated if necessary.

A careful find and replace on the entire VBA code is also required.

Then test everything. It is surprising where a tablename can lurk.
 
Look at "FindRecord" (attachment, zip, word)
Open any VBA code in your mdb.
Click on FIND (Ctrl+F) icon.
Select CURRENT PROJECT (search).
Click on "REPLACE" button.
In "Find What" write what do you want to find.
In "Replace with" write an new name of tbl.
Use "Find next" and "Replace" buttons to go on.
 

Attachments

although if you are on A97, i don't think the table changes happen automatically.

the biggest issue is likely to be in queries, if the table name doesnt correct automatically

work on a copy of the dbs

just change it, and see what breaks.
 
Thanks guys so my list so far is

relink new table names
Code - Find and Replace
Controls - check them all manually
Queries - check them all manually


I have a SQL Server backend so A change of table name there is not going to automatically change anything in the MDB - further I am live.
 

Users who are viewing this thread

Back
Top Bottom