I am using Access 2002 with windows XP. I have a Access 2002 database that runs off my laptop but links to tables on our server. The application allows for the user to select different data files then drops the current data files and links to the newly selected ones. This works fine most of the time but recently I when this happens Access has been freezing up.
Has anyone encountered a similar issue and is there a solution?
I had no end of problems with the link removal and re-application. I found the following code to be the most stable:
Dim dbs As Database
Dim tdf As TableDef
Dim strDBNewPath as String
' Remove All Links
For Each tdf In CurrentDb.TableDefs
If Left(tdf.Name, 4) <> "MSys" And (tdf.Attributes And dbAttachedTable) = dbAttachedTable Then
' Refresh all Links
Set dbs = OpenDatabase(strDBNewPath)
For Each tdf In dbs.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
DoCmd.TransferDatabase acLink, "Microsoft Access", Trim(strDBNewPath), acTable, tdf.Name, tdf.Name