Need to Rename Table Name

Number11

Member
Local time
Today, 11:24
Joined
Jan 29, 2020
Messages
625
Please could someone help here, i need to change a current table within the backend of a split database but will all of te queries linked to the current table get updated or will i have to updated every query?
 
You will have to update every query.


See the code I posted in this thread to search all the querydefs for specific text

Object dependencies using VBA | Access World Forums (access-programmers.co.uk)

if you search for your table name, you can simply replace every occurrence of the old table name with the new table name. You don't have to explicitly save the query. Simply this does the job. DAO is working directly on the SQL string which is actually the query.

qry,SQL = replace(qry.SQL, "old table name", "new table name")

note that if you have a space in the new table name and didn't before, you need square brackets [] around the new table name.

Copy your database before you do this, in case something goes wrong!
 
Unlike Pat, I do recommend renaming the BE table then creating an alias which has the original table name. Doing that means all your queries and code will continue to work perfectly. Just make sure you make a backup and have Name Autocorrect switched off before you do this.

Whilst it may seem that just turning on Name Autocorrect' will allow the name change to 'percolate through' it will almost certainly fail to update certain queries e.g crosstab IIRC...and it doesn't make any changes to code.
 

Users who are viewing this thread

Back
Top Bottom