VBA.FileCopy

Discussion in 'Microsoft Access Form Coding' started by Kindergarten Teacher, May 12, 2006.

  1. I am receiving "vba filecopy 75 path/file access error" when I try to use any
    kind of a copy command inside of vba for Access 2002. The Visual Basic
    version is 6.3

    Here is a simplified version of the code.

    MkDir "C:\To"
    filepicked = "C:\From\test.txt"
    directorypicked = "C:\To"
    VBA.FileCopy filepicked, directorypicked

    I have no problem creating the new directory using this code.

    The file exists and the path is correct.
    After each attempt the "To" directory was removed so it could be successfully
    recreated.

    There doesn't seem to be permission problems. I can run a copy command at a
    DOS prompt and successfully copy the file to the new directory.

    I have the path variables declared as strings - I've also tried as variants

    When run in my application the code does create the "To" directory but gives
    the error 75 message when it tries to copy the file to the new directory.
     
    Kindergarten Teacher, May 12, 2006
    #1
    1. Advertisements

  2. Kindergarten Teacher

    John Nurick Guest

    From the FileCopy help topic:

    destination: Required. String expression that specifies the target
    file
    name. The destination may include directory or
    folder, and drive.
     
    John Nurick, May 12, 2006
    #2
    1. Advertisements

  3. Face is red. It was so simple I missed it.

    I was thinking the destination merely had to be the path to the directory -
    as you would in Unix.
    Know I know that you must specific the name of the file in the destination as
    well.

    Tried it out in my simple test on the C drive and it worked. Now I need to
    set it to work on the network drives

    John, you get a gold star for your forehead.

     
    Kindergarten Teacher, May 12, 2006
    #3
  4. Kindergarten Teacher

    John Nurick Guest

    Thank you for the gold star. Do all kindergarten teachers know Unix?

     
    John Nurick, May 12, 2006
    #4
  5. Don't think so, but they should.

    I started out programming on the Atari (ignoring your snickers) . It was a
    great machine for my needs. Lots of color, sound, and fast animation. I made
    a lots of programs for the children to use. The students in my class
    consistently finished the school well ahead of their peers.

    Sadly, I saved the programs on cassette tapes and with a thermal printer.
    They are all gone now.

    I went back to school to get another BS in Computer Science, where I learned
    Unix. I'm not teaching at the moment because I need money that I wasn't
    getting in teaching; but I'm looking forward to going back. But not to the
    public school system.

    Computers are fun and challenging but teaching is much more fun and much,
    much more challenging.

    Thanks again,
    Wayne

     
    Kindergarten Teacher via AccessMonster.com, May 12, 2006
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...