I tried looking this up and maybe I am using the wrong words, but I can't seem to find anything. That will help me.
What I need to do is loop through all the tables in the database which start with the word "Agreement" and take out the word "Agreement" from the title.
It seems simple... but I don't know how to make it work... can someone help me here?
Here's the code I have which loops through the tables... but I don't know how to reference the table name in order to cange it:
Thanks for your help!
-Gary
What I need to do is loop through all the tables in the database which start with the word "Agreement" and take out the word "Agreement" from the title.
It seems simple... but I don't know how to make it work... can someone help me here?
Here's the code I have which loops through the tables... but I don't know how to reference the table name in order to cange it:
Dim dbCurr As DAO.Database
Dim intLoop As Integer
Dim tblName As String
Dim tblNewName As String
Set dbCurr = CurrentDb()
For intLoop = (dbCurr.TableDefs.Count - 1) To 0 Step -1
If Left$(dbCurr.TableDefs(intLoop).Name, 4) = "Agre" Then
tblName = dbCurr.TableDefs(intLoop).Name
tblNewName = Mid(tblName, 10, Len(tblName) - 9)
'OK so here is where I am missing the correct code
'what I want to say is something like:
'dbCurr.TableDefs(intLoop).Name tblNewName (but I know this won't work...)
End If
Next intLoop
Set dbCurr = Nothing
End Function
Thanks for your help!
-Gary