ولا يهمك أخي العزيز ، هذا تعديل على الكود ليوافق طلبك :
Public Function ReLink()
Dim BEPath As String
Dim wrkJet0 As Workspace
Dim dbs0 As DAO.Database
BEPath = DFirst("database", "msysobjects", "[Database]<> '""'")
Set wrkJet0 = DBEngine.Workspaces(0)
Set dbs0 = wrkJet0.OpenDatabase(BEPath, False, False, ";PWD=" & "000000")
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Set db = CurrentDb()
For Each tdf In db.TableDefs
If (tdf.Attributes And dbAttachedTable) = dbAttachedTable Then
On Error Resume Next
tdf.Connect = ";DATABASE=" & BEPath
tdf.RefreshLink
End If
Next
End Function
وأخبرني إن واجهت فيها أي مشكلة ..