Hi

I added some code to the exit button on a database to automatically save a back up copy in separate location - code included with path removed.

For some reason it only works for about half of my team, others get a error message - screen shot attached.

Does anyone know why it works for some people and not others? Thank you
Error.jpg

Private Sub Command220_Click()
Dim Source As String
Dim Target As String
Dim retval As Integer
 
Source = CurrentDb.Name
 
'This is the only thing to change - add the path of where you want the file to save here
Target = "FILE PATH \"
Target = Target & "Enquiry Line " & Format(Date, "dd mmmm yyyy") & " " & Format(Time, "hh mm") & " " & Environ$("Username") & ".accdb"
 
' create the backup
retval = 0
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
retval = objFSO.CopyFile(Source, Target, True)
Set objFSO = Nothing
Application.quit
End Sub