Results 1 to 2 of 2
Thread: A2007 Linked File Names
2009-09-18, 06:42 #1
- Join Date
- Sep 2005
- Thanked 0 Times in 0 Posts
I have one database that links to SharePoint lists stored on many different workspaces. Each of the workspaces is identically created, so that each space has lists named "Products," "Customers." "Regions", etc. The field names in each table are identical.
When I link to the lists with Access, my table structure becomes "Products" "Products1" "Products2"
Is there a way to programmatically change the names of the tables, allowing me to have more meaningful names? I'd like to be able to have "Products_PA" "Products_OH" "Products_NY" so that I don't need to continually use an off-line list to know which table I'm working with.
I know that I can do this manually using 'rename' on each linked table, but there are so many that it would be worth while to be able to write the code and, by passing a parameter, have the identifier added as a suffix to the newly added table names.
The table MSysObjects seems to be read only, and I can't figure out how to run a query against it; nor do I know the code to use to get to the name property.
2009-09-18, 06:49 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
The syntax to rename a table is
DoCmd.Rename "tblNew", acTable, "tblOld"
Note that the new name is the first argument and the old name the last argument.
You can, of course, use variables or expressions instead of "tblNew" and "tblOld".