Is there any way to create a button on a form that synchronizes
the master database with a replicated access database?
Well, first off, if you're talking about the Design Master, you
shouldn't be using that for production editing. The DM is a special
replica and the only proper use for it is to make design changes. It
should be kept somewhere safe and synched only as often as necessary
to keep it from expiring (the default retention period is 1000
days).
Any two replicas can be synched from a command button. The level of
complexity of the task depends on your environment (whether all
replicas are local to the LAN or not) and how much error checking
you want (do you want to check for conflicts after the synch, etc.).
In a properly split application, you'll need to get the name of the
back end replica. This can be gotten from:
Mid(CurrentDB.TableDefs("LinkedTable").Connect, 11)
Assuming a direct synch using DAO (the easiest task), you'd have
code behind the command button something like this:
Dim dbLocal As DAO.Database
Dim strLocal As String
strLocal = Mid(CurrentDB.TableDefs("LinkedTable").Connect, 11)
Set dbLocal = DBEngine.OpenDatabase(strLocal)
dbLocal.Synchronize "Path/Filename of partner replica"
dbLocal.Close
Set dbLocal = Nothing
The hard part is supplying the name of the remote replica. In most
cases, I'd suggest that you'd be synching from known location to
known location, so it can be hardwired, or from a laptop to a
central server replica. In the latter case, you could hardwire the
path to the central hub that everyone synchs with and use the
Connect string to get the laptop's replica name.