I am trying to dynamicaly reconnect a table linked to a text file when a user opens the mdb. I think that my best bet will be to use the RefreshLink method and I was wondering if anybody had an example of how to use it. I have very little VB/VBA experience and am stuck...
this code goes through all tables and changes LINK into new mdb (the tables which need to be refreshed start with TBL e.g. TBLOrders) - you can easily change that, the code checks if the table IS currently linked to MyMDB.mdb and i yes, it re-links it.
I used it because I had special export.mdb un users' desktops ...
For Each strTable In CurrentDb().TableDefs
If Left(strTable.Name, 3) = "tbl" Then
If InStr(strTable.Connect, strMyMDB) > 0 Then
strTable.Connect = ";DATABASE=" & strMyNewMDB
i = i + 1