Here is code I use to reset table links:
Code:
Public Sub NormalizeTableLinks()
'Relink tables with UNC pathing
'Use the variables provided to do the manipulations desired
Dim td As TableDef
Dim db As DAO.Database
Dim strOld As String
Dim strNew As String
'replace the following strings as needed
strOld = "R:\Lab\Database\Data\LabData.accdb"
strNew = gstrBasePath & "Data\LabData.accdb"
Set db = CurrentDb
For Each td In db.TableDefs
If InStr(td.Connect, strOld) > 0 Then
Debug.Print td.Name
Debug.Print "Old Link: " & td.Connect
td.Connect = Replace(td.Connect, strOld, strNew)
td.RefreshLink
Debug.Print "New Link: " & td.Connect
End If
Next td
db.TableDefs.Refresh
End Sub
Why do you have a database for each year? Do you have that much data?