Scenario:
Currently calling the function SynchronizeDBs in the On Open Event of the Start-up form. The function is called out as follows:
=SynchronizeDBs("C:\Documents and Settings\...\IDB HubR1.mdb","\\ww007\...IDB Hub.mdb",1)
The function code is:
Function SynchronizeDBs(strDBName As String, strSyncTargetDB As String, _
intSync As Integer)
Dim dbs As DAO.Database
Set dbs = DBEngine(0).OpenDatabase(strDBName)
Select Case intSync
Case 1 'Synchronize replicas (bidirectional exchange).
dbs.Synchronize strSyncTargetDB, dbRepImpExpChanges
Case 2 'Synchronize replicas (Export changes).
dbs.Synchronize strSyncTargetDB, dbRepExportChanges
Case 3 'Synchronize replicas (Import changes).
dbs.Synchronize strSyncTargetDB, dbRepImportChanges
Case 4 'Synchronize replicas (Internet).
dbs.Synchronize strSyncTargetDB, dbRepSyncInternet
End Select
dbs.Close
End Function
So in this case it is performing a direct bidirectional exchange when the DB starts up.
Problem (what I am trying to solve):
If the DB is not connected to the server it shows a runtime error and will only let me end or debug. The DB start-form will not run.
I would like for the remote users to be able to enter the DB even if not connected. So I would like for the function to run, but on error continue to open the DB normally. For me that would ensure that when they are connected the information exchange is intact, but when not connected they can still use the DB without any interruption.
I hope this is clear. I am not an access expert or a vba expert so suggestions of an alternative to get to the end would be helpful also. Thank you in advance.
Currently calling the function SynchronizeDBs in the On Open Event of the Start-up form. The function is called out as follows:
=SynchronizeDBs("C:\Documents and Settings\...\IDB HubR1.mdb","\\ww007\...IDB Hub.mdb",1)
The function code is:
Function SynchronizeDBs(strDBName As String, strSyncTargetDB As String, _
intSync As Integer)
Dim dbs As DAO.Database
Set dbs = DBEngine(0).OpenDatabase(strDBName)
Select Case intSync
Case 1 'Synchronize replicas (bidirectional exchange).
dbs.Synchronize strSyncTargetDB, dbRepImpExpChanges
Case 2 'Synchronize replicas (Export changes).
dbs.Synchronize strSyncTargetDB, dbRepExportChanges
Case 3 'Synchronize replicas (Import changes).
dbs.Synchronize strSyncTargetDB, dbRepImportChanges
Case 4 'Synchronize replicas (Internet).
dbs.Synchronize strSyncTargetDB, dbRepSyncInternet
End Select
dbs.Close
End Function
So in this case it is performing a direct bidirectional exchange when the DB starts up.
Problem (what I am trying to solve):
If the DB is not connected to the server it shows a runtime error and will only let me end or debug. The DB start-form will not run.
I would like for the remote users to be able to enter the DB even if not connected. So I would like for the function to run, but on error continue to open the DB normally. For me that would ensure that when they are connected the information exchange is intact, but when not connected they can still use the DB without any interruption.
I hope this is clear. I am not an access expert or a vba expert so suggestions of an alternative to get to the end would be helpful also. Thank you in advance.