Hi all,
Working in access 2003 database with objects without naming convention. Does anyone know of code or utility to adding a prefix such as tbl to objects? Manually would take such a long time!
Thanks
Hi all,
Working in access 2003 database with objects without naming convention. Does anyone know of code or utility to adding a prefix such as tbl to objects? Manually would take such a long time!
Thanks
You could try this but be sure to make a backup of your db first.Code:Public Sub PrefixTblName() Dim t As TableDef For Each t In CurrentDb.TableDefs If Left(t.Name, 4) <> "MSys" Then t.Name = "tbl" & t.Name End If Next End Sub
If this helped, please click the star at the bottom left of this posting and add to my reputation. Many thanks.
Bob Fitzpatrick
Your problem could be a lot more involved than that.
For a start I would do it manually just incase things fail if you use code.
But you then have to change the table names in any query that you have created.
I think the trick is to open the query in Datasheet view. Do not go to design view.
Close the Datasheet view and then save the query. The table names within the queries should update this way, thereby saving a lot of heartache.
My directions may be a bit off so test it first, or perhaps someone else knows more.
This worked. Changed the table names. Will this work with renaming queries and forms? qryName and frmForm???
Thanks