Results 1 to 2 of 2
  1. #1
    thescottsman92 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Aug 2013
    Posts
    13

    FileCopy


    Hi

    I have a problem in the copyfile function. It says "CompileError - Expected =" and I am not sure if im even setting this correctly. This is my cde:

    Dim fso As Object
    Set fso = VBA.CreateObject(filesystemobject)
    fso.copyfile(me.txtPath,me.txtarchivepath & me.txtnewfile)

    I think the problem is the "filesystemobject bit in the code

    can anyone please help me

    thanks very much

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Don't need FileSystemObject to copy a file. VBA has an intrinsic function for that.

    Try:
    FileCopy me.txtPath, me.txtarchivepath & me.txtnewfile
    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.

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

Similar Threads

  1. FileCopy Funtion
    By dccjr in forum Programming
    Replies: 2
    Last Post: 04-18-2013, 09:04 PM

Tags for this Thread

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