PC Review


Reply
Thread Tools Rate Thread

Close objects and re-open switchboard

 
 
=?Utf-8?B?TWljaGFlbCBXYWxzaA==?=
Guest
Posts: n/a
 
      7th Dec 2004
With a little help, I figured out how to synchonize using code.

The code works great, but I'm thinking that I should probably have all the
objects close and then reopen my switchboard so that the changes are
reflected based on the sync. Any ideas? Here's the post with my code.

What would I add to the code to close open objects and then reopen the form
switchboard?

"Michael Walsh" wrote:

> I also wasn't sure how to call this procedure in the switchboard so I
> converted it to a function I think and made the pathname dynamic. I do have
> one question about this method of synchronization and conflict resolution.
> Does it still work the same or will the conflict resolution manager have to
> be called manually?
>
> Here's the modified code...
> Function Sync()
> 'Sub synchronizeDB()
> Dim cloneDb As DAO.Database
> Dim strDBPath As String
> Dim strDBFile As String
> strDBPath = CurrentDb.Name
> strDBFile = Dir(strDBPath)
> CurrentDBDir = Left$(strDBPath, Len(strDBPath) - Len(strDBFile)) &
> strDBFile
>
>
> On Error GoTo ERR_synchronizeDB
> Screen.MousePointer = 11
>
>
> strDefFile = CurrentDBDir
> strNetFile = "\\netcopy.mdb"
>
> Set cloneDb = DBEngine.Workspaces(0).OpenDatabase(strDefFile)
> cloneDb.Synchronize strNetFile, dbRepImpExpChanges
> Screen.MousePointer = 0
> 'Exit Sub
> MsgBox ("Synchronization is complete")
> GoTo exitpart
>
> ERR_synchronizeDB:
> Screen.MousePointer = 0
> MsgBox Error$
> MsgBox (CurrentDBDir)
> 'Exit Sub
> 'End Sub
> exitpart:
> End Function
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close the Switchboard, Close the Database =?Utf-8?B?QXByaWwgS2xlaW4=?= Microsoft Access Forms 2 25th Aug 2006 08:22 PM
Switchboard and sub-switchboard =?Utf-8?B?QW5naWVD?= Microsoft Access Forms 3 22nd Jul 2006 08:00 AM
Objects, objects, so many objects! ;-) thechaosengine Microsoft Dot NET 11 18th Dec 2004 01:35 PM
Objects, objects, so many objects! ;-) thechaosengine Microsoft C# .NET 10 16th Dec 2004 05:04 PM
Re: switchboard and switchboard override Joan Wild Microsoft Access Security 0 9th Jul 2003 04:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:43 AM.