hfsitumo2001
Member
- Local time
- Yesterday, 23:55
- Joined
- Jan 17, 2021
- Messages
- 394
This is my VBA to create the back up file, when I pressed the botton, the back up is created. I waited for 2 minutes. How can I make it that there is a message to say, "backup complete" when it finished.
Code:
Public Function CreateBackup() As Boolean
Dim Source As String
Dim Target As String
Dim objFSO As Object
Dim Path As String
Source = CurrentDb.Name
'Path = CurrentProject.Path
Path = "C:\EVSInventoryBkup"
Target = Path & "\EVSbkupDB_" & Format(Now, "mm-dd-yy-hh-mm-ss") & ".accdb"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.folderExists(Path) Then
a = objFSO.copyfile(Source, Target, True)
Else
objFSO.Createfolder (Path)
a = objFSO.copyfile(Source, Target, True)
End If
Set objFSO = Nothing
Set a = Nothing
End Function