I have created a MS Access database that is written using three (3) databases. One is a front end for the users (several users). The other two (2) are data storage tables only. The two data storage tables are identical (databases named the same, tables named the same...). One is stored locally on each users laptop and one is on the network (shared). The purpose of this arrangement is to allow the user a read only version of the data when off line traveling by using their local tables. They can make changes to the data when on line - these changes will be made to the on-line tables. I've written databases in MS Access for about 10 years, but I build mostly in queries. I'm not strong in VBA. Ideally I could get the VBA code to link to a button that changes the link from one data storage database to the other. I will then use this code to make an 'on-line' button and an 'off-line' so I can toggle back and forth. Thanks so much for your time and knowledge. I do appreciate it.
Asked
Active
Viewed 308 times
0
-
Possible Duplicate : https://stackoverflow.com/questions/4928134/changing-linked-table-location-programatically – Harshit kyal Jan 08 '18 at 06:04
-
Thank you, thank you...The post from usncahill on 17-Jan-2017 as listed below was perfect. – Bruce Jan 08 '18 at 12:50
-
Public Sub Fix_Table_Locations() Dim tbl As TableDef, db As Database, strConnect As String Set db = CurrentDb For Each tbl In db.TableDefs If InStr(tbl.Connect, "Portion of connect string to change") > 0 Then tbl.Connect = Replace(tbl.Connect, "Portion of connect string to change", "New portion of connect string") tbl.RefreshLink End If Next End Sub – Bruce Jan 08 '18 at 12:50