Consulting

Results 1 to 4 of 4

Thread: Error when backing up DB (not all users)

  1. #1
    VBAX Contributor
    Joined
    Jul 2011
    Location
    Manchester
    Posts
    142
    Location

    Error when backing up DB (not all users)

    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

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Hi, this sounds suspiciously like an MS Security Update issue ie different levels on different machines.
    Although you can get similar issues with Drive & Folder permission differences.
    So I would check the latest updates on the problem users computers compared to the OK ones and then check that everybody has the same permissions.

  3. #3
    VBAX Contributor
    Joined
    Jul 2011
    Location
    Manchester
    Posts
    142
    Location
    Hi.

    Thank you, it was permission to the back up folder though not sure how as we cannot set our own permissions!

    The users with issues could't access the folder manually so i just copied everything into a new folder and changed the file path to the new folder and it works for everyone now.

    Thank you AGAIN for you help

    Mykal

  4. #4
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •