in my app i separated tables database from interface.no in interface file i had some linked tables. i put both files (interface & data file) in same directory. in add external data i didnt use complete address, i only types data file name. so it must be ok when i change the app directory. but when i try to open interface file in other PCs with different address, it still try to find data file from the same address in my pc. & user must add external data again.
even when i get the the property of linked tables, it shows my PCs address.
is it access bug or something?
Here is a function that allows to modify the path of the attached tables when you move both the front-end and the back-end files. It works only if:
1. All the attached tables are in one or more databases (back-end(s)) located in the same folder as the front-end.
2. All the attached tables are from one or more Access back-end.
Dim tdf As DAO.TableDef
Dim strPath As String
Dim strDb As String
For Each tdf In CurrentDb.TableDefs
If Len(tdf.Connect) Then
tdf.Connect = Left(tdf.Connect, InStr(tdf.Connect, "=")) & CurrentProject.Path & Mid(tdf.Connect, InStrRev(tdf.Connect, "\"))
Set tdf = Nothing