Dim bckup As FileSystemObject
On Error GoTo Unsuccessful
Dim strBckupName As String
strBckupName = "BackupDB - " & Format(Date, "mm.dd.yyyy") & " - " & Format(Time, "hhmmss") & ".mdb"
Set bckup = New FileSystemObject
bckup.CopyFile Application.CurrentProject.FullName, Application.CurrentProject.Path & "\Backups\" & strBckupName, True
Set bckup = Nothing
Beep
MsgBox "Backup was successful and saved @ " & Chr(13) & Chr(13) & Application.CurrentProject.Path & "\Backups" & Chr(13) & Chr(13) & "The backup file name is " & Chr(13) & Chr(13) & strBckupName, vbInformation, "Backup Completed"
End
Unsuccessful:
MsgBox "Backup unsuccessful. Check:" & Chr(13) & Chr(13) & "- The disk you are saving to is not full" & Chr(13) & Chr(13) & "AND" & Chr(13) & Chr(13) & "- That a 'backups' folder has been created in the directory of the active database", vbExclamation, "Backup Unsuccessful"