Problems Creating a SynchNow Macro

MsfStl

Registered User.
Local time
Today, 17:19
Joined
Aug 31, 2004
Messages
74
Good afternoon,

I searched for answers to this within this forum, and while the problem has been presented previously no one had any responses. So, I'll give it a go and have faith someone can point me in the right direction.

I have a replicated database across a server network, so that I can make changes to the forms and then update the db on the users side. what I would like to do is install an AutoSync button that the user would use both at the beginning of their session and at the end of their session. At the beginning to capture any changes I may have made and at the end to update the tables. However, when I bring this cmdbutton over to the user's db and try to run it, I receive a HALT message with the runcommand listed and a code 264. However, if I go into debug mode I can immediately step into the macro with F8, BUT the sync never completely finishes because the program does not start back up. I am sure I am probably going about this a** backwards, but this is the most direct method I can think of.

Any help or suggestions would be greatly appreciated. Thank you in advance.

Scot
 
I suspect most of us don't use replication for this, we simply use some utility that copies the new front end to the client PC's when a new version is available. BobLarson has posted one, if you want to search on that. Others use batch files, I wrote one in VB, etc.
 
Replication is not at all suitable for pushing out changes to a front end.

First off, there is no multi-user Access application that should not be split into a front end (forms/queries/reports/macro) and back end (data tables ONLY).

Second, replication DOES NOT WORK with front end objects (except for queries). Well, it works for a while, but eventually it corrupts the whole project.

Replication works beautifully for data tables and that's the only thing it should ever be used for.

I've never used a macro for this kind of thing, because macros have no error handling. It's very easy to create a command button on a form that does the job. It would look something like this:

Code:
  Dim dbLocal As DAO.Database

  Set dbLocal = DBEngine.OpenDatabase("C:\MyLocalReplica.mdb")
  dbLocal.Synchronize "\\Server\MyRemoteReplica.mdb"

  dbLocal.Close
  Set dbLocal = Nothing

Put that code in the OnClick of a command button on a form, or make a macro that calls it with RunCode and then you can use it on a Switchboard form.

Now, it's important that if you're synching across a WAN that you *not* do it this way, as it's a direct synch, which opens the replicas on both ends, and is very susceptible to corrupting the remote replica. But if it's on a wired LAN (wireless is also unacceptable), then it's fine.
 
Thank you dfenton, as I mentioned, I knew I was doing this wrong, but I have no other direction as to how I should do this except for what I can garner here and at other helpful forums. Again, thank you for your time.
Scot
 
Thanks Bob,

I ran a quick search earlier and did not find that link. I have it now and will look at, if I get time this weekend. Just from skimming across the two pages of posts on that link I am sure this will help me to understand this process. Thank you for all your help.

Scot
 

Users who are viewing this thread

Back
Top Bottom