Lets just say you have a 5 man team out in the field that isn't on the server. And at the end of the day we use a update/append code that updates their work to a Main/Back End Database on your Network.
Something like the code below, ... I'm open to ideas... or someone convince me its a waist of time, or cant be done. The code below just deletes and copies over...Not good, because there will be a crew in the office working on the network as well.. I only listed 6 Tables but, there's actually 15 total tables.
Something like the code below, ... I'm open to ideas... or someone convince me its a waist of time, or cant be done. The code below just deletes and copies over...Not good, because there will be a crew in the office working on the network as well.. I only listed 6 Tables but, there's actually 15 total tables.
VBA Code:
Sub UpdatePublicDatabase()
Dim con As Object
Set con = CreateObject("ADODB.Connection")
On Error GoTo UpdatePublicDatabase_OpenError
con.Open _
"Driver={Microsoft Access Driver (*.mdb, *.accdb)};" & _
"Dbq=C:\Users\SHF00\Desktop\Database27_Backup's\Database271_be.accdb;" & _
"Exclusive=1;" & _
"Uid=admin;" & _
"Pwd=;"
On Error GoTo 0
con.Execute "DELETE FROM SRD"
con.Execute "INSERT INTO SRD SELECT * FROM [MS Access;DATABASE=" & Application.CurrentDb.Name & ";].[SRD]"
con.Execute "DELETE FROM SDI"
con.Execute "INSERT INTO SDI SELECT * FROM [MS Access;DATABASE=" & Application.CurrentDb.Name & ";].[SDI]"
con.Execute "DELETE FROM SSDR"
con.Execute "INSERT INTO SSDR SELECT * FROM [MS Access;DATABASE=" & Application.CurrentDb.Name & ";].[SSDR]"
con.Execute "DELETE FROM MCF"
con.Execute "INSERT INTO MCF SELECT * FROM [MS Access;DATABASE=" & Application.CurrentDb.Name & ";].[MCF]"
con.Execute "DELETE FROM TVD"
con.Execute "INSERT INTO TVD SELECT * FROM [MS Access;DATABASE=" & Application.CurrentDb.Name & ";].[TVD]"
con.Execute "DELETE FROM WPS"
con.Execute "INSERT INTO WPS SELECT * FROM [MS Access;DATABASE=" & Application.CurrentDb.Name & ";].[WPS]"
con.Close
Debug.Print "Done."
Exit Sub
UpdatePublicDatabase_OpenError:
Debug.Print "Exclusive 'Open' failed. Quitting."
Exit Sub
End Sub