I am using the following code to back up the DB on exiting. It works fine and each time overwrites the backup. I haven't found a way to change the code to write to a new backup each time. I am wanting multiple backups. Any suggestions?
Thanks
Dim DestFile
Dim strDestFileName
Dim strNow
Dim aSFO
strNow = Year(Date) & "-" & Month(Date) & "-" & Day(Date) & "-" & Hour(Now) & "-" & Minute(Now)
strDestFileName = "SoinVolunteerDB_Backup_" & strNow & ".accdb"
DestFile = "S:\Soin Volunteer Training Access Data\TrainingDBBackup" & strDestName
SourceFile = "S:\Soin Volunteer Training Access Data\NewVolunteerTraining.accdb"
Set aFSO = CreateObject("Scripting.FileSystemObject")
aFSO.CopyFile SourceFile, DestFile
DoCmd.SetWarnings True
MsgBox "Date Base Has Been Successfully Backed Up"
'Exit Access
DoCmd.Close
DoCmd.Quit