Hi,
with the code below, I was successfully backing up my database regularly until I separated the Front end and used linked tables. Now only the linked tables are being backed up. (Not much good)!
how can I reference my BackEnd Tables Database 'acc.mdb' and create an automated copy.
I have tried adding the following code to make the BE_Tables database as CurrentDatabase , but it did not work.
Help is greatly appreciated.
with the code below, I was successfully backing up my database regularly until I separated the Front end and used linked tables. Now only the linked tables are being backed up. (Not much good)!
how can I reference my BackEnd Tables Database 'acc.mdb' and create an automated copy.
Code:
Private Sub BackupData() Dim sFile As String Dim objectDB As DAO.Database Dim oTbl As TableDef sFile = "s:\acc_" & Format(Date, "ddmmyyyy") & ".mdb" If Dir(sFile) <> "" Then Kill sFile Set objectDB = DBEngine.Workspaces(0).CreateDatabase(sFile, dbLangGeneral) objectDB.Close DoCmd.Hourglass True For Each oTbl In CurrentDb.TableDefs If Left(oTbl.Name, 4) <> "msys" Then DoCmd.CopyObject sFile, , acTable, oTbl.Name End If 'DoCmd.TransferDatabase acExport, "Microsoft Access", sFile, acTable, oTD.Name Next oTbl DoCmd.Hourglass False End Sub
Code:
... Dim oDB2 As dao.Database Dim sData As String sData = "s:\acc786_data.mdb" Set oDB2 = DBEngine.Workspaces(0).OpenDatabase(sData) DoCmd.Hourglass True For Each oTbl In oDB2.TableDefs ...
Comment