Hello,
This is the code that makes the database to backup on open. Any idea how to make it to put files from a specific date (let's say Sep-06) into a folder called 2016-Sep-06?
Thanks!
This is the code that makes the database to backup on open. Any idea how to make it to put files from a specific date (let's say Sep-06) into a folder called 2016-Sep-06?
Code:
Function fMakeBackup() As Boolean
Dim Source As String
Dim Target As String
Dim retval As Integer
Source = CurrentDb.Name
Target = "C:\Users\chnj\Desktop\backenddb"
Target = Target & Format(Date, "mm-dd") & " "
Target = Target & Format(Time, "hh-mm") & ".accdb"
' create the backup
retval = 0
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
retval = objFSO.CopyFile(Source, Target, True)
Set objFSO = Nothing
End Function
Thanks!