Quis adaptar este código mas dá erro na linha nº 10 "Tdf.RefreshLink"
Estou a utilizar o Office 2007
Luís Antunes
Estou a utilizar o Office 2007
- Código:
Private Sub Form_Open(Cancel As Integer)
Call ReVincularTabelas("C:\BackEnd.mdb")
End Sub
Public Sub ReVincularTabelas(CaminhoDasTabelas As String)
Dim Dbs As Database
Dim Tdf As TableDef
Dim Tdfs As TableDefs
Set Dbs = CurrentDb
Set Tdfs = Dbs.TableDefs
For Each Tdf In Tdfs
If Tdf.SourceTableName <> "" Then
Tdf.Connect = ";DATABASE=" & CaminhoDasTabelas
Tdf.RefreshLink
End If
Next
Luís Antunes