Hi EE
I have the following code to re-link data
Dim strPathBE As String
Dim tdf As TableDef
With FileDialog(msoFileDialogFilePicker)
If Not .Show Then Exit Sub
strPathBE = .SelectedItems(1)
End With
With CurrentDb
For Each tdf In .TableDefs
If tdf.Attributes And dbSystemObject Then
ElseIf Len(tdf.Connect) = 0 Then
ElseIf Left(tdf.Connect, 1) <> ";" Then
Else
tdf.Connect = ";DATABASE=" & strPathBE
tdf.RefreshLink
End If
Next tdf
Me!txtLoc = strPathBE
End With
It works if data has no password. I assume it needs some extra code to handle password.
something at the end of this line perhaps
tdf.Connect = ";DATABASE=" & strPathBE (Password)
Any help appreciated
chestera
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.