Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy a file (Access 2002)

    I am trying to use VBA code to copy a DOS file from one location to another. I tried to follow the instructions for CopyFile from the help menu:

    FileSystemObject.CopyFile "NATAFILEATCH.dbf", "N:NEWLOC"

    I get the message "Object Required". What am I doing wrong? Is something else supposed to be typed in place of FileSystemObject?
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy a file (Access 2002)

    Judy Try:

    FileCopy "NATAFILEATCH.dbf", "N:NEWLOCATCH.dbf"

    Notice the function is "FileCopy" not CopyFile, and the full destination including file name.

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy a file (Access 2002)

    Thanks that worked. When I looked it up in help I didn't realize that there were two different commands one called CopyFile and the second called FileCopy.

    FileCopy is definitely much easier to use.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

Posting Permissions

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