Hi,
I have this piece of code (contributed by one of you great people out there) which is quite handy for relinking tables in the Access frontend to the backend eg if it has moved.
I wonder if anyone has coded a way that when the function is called...the user can browse to the location of the backend db?
Here is the function as it stands now.
Function relinkTables(newPath)
Dim td As DAO.TableDef
For Each td In CurrentDb.TableDefs
On Error Resume Next
If (td.Attributes And dbAttachedTable) = dbAttachedTable Then
If LCase(td.Connect) <> LCase(";DATABASE=" & newPath) Then
td.Connect = ";DATABASE=" & newPath
td.RefreshLink
End If
End If
On Error GoTo 0
Next
End Function
Any help is greatly appreciated.
Regards,
Peter Remember- It's nice to be important,
but it's important to be nice![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I have this piece of code (contributed by one of you great people out there) which is quite handy for relinking tables in the Access frontend to the backend eg if it has moved.
I wonder if anyone has coded a way that when the function is called...the user can browse to the location of the backend db?
Here is the function as it stands now.
Function relinkTables(newPath)
Dim td As DAO.TableDef
For Each td In CurrentDb.TableDefs
On Error Resume Next
If (td.Attributes And dbAttachedTable) = dbAttachedTable Then
If LCase(td.Connect) <> LCase(";DATABASE=" & newPath) Then
td.Connect = ";DATABASE=" & newPath
td.RefreshLink
End If
End If
On Error GoTo 0
Next
End Function
Any help is greatly appreciated.
Regards,
Peter Remember- It's nice to be important,
but it's important to be nice