Results 1 to 5 of 5
  1. #1
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138

    Move file

    I am trying to move a file to other folder , then rename the file.



    The rename file part is working, but I cannot get to move the file to other folder.

    Code:
    Private Sub savetbn_Click()
    
    FileCopy "D:\Users\HBezuidenhout\Documents\Tapes\access\insert.xlsm", "D:\Users\HBezuidenhout\Documents\Tapes\insert.xlsm"
    
    Name "D:\Users\HBezuidenhout\Documents\Tapes\Insert.xlsm" As "D:\Users\HBezuidenhout\Documents\Tapes\" & Format(Date, "yyyy mm dd") & ".xlsm"
                                   
    End Sub

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    What does 'cannot' mean - error message, wrong result, nothing happens? It works on my laptop.

    Should be able to do move and rename with just Name method - original file is deleted. What you are doing is copy and rename - original file is unchanged.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    Quote Originally Posted by June7 View Post
    What does 'cannot' mean - error message, wrong result, nothing happens? It works on my laptop.

    Should be able to do move and rename with just Name method - original file is deleted. What you are doing is copy and rename - original file is unchanged.
    Sorry should have give info there.

    Getting run-time error '70"
    permision denied

    I do have a password to get into the database, I did sine in with it, but still give error.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    May be running into a security restriction with Windows on a network. I used to be able to programmatically copy file on network at work but then new computers blocked this. Review https://stackoverflow.com/questions/...mission-denied

    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    Got it working, fault at my side, the file was open, and I did not see it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-30-2015, 05:52 AM
  2. Replies: 3
    Last Post: 12-11-2014, 11:26 AM
  3. Replies: 2
    Last Post: 07-02-2014, 09:46 AM
  4. Replies: 4
    Last Post: 10-30-2012, 02:54 PM
  5. Have access rename a .txt file and move it
    By dh010010 in forum Programming
    Replies: 5
    Last Post: 07-22-2010, 10:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums