[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access 2010 VBA Runtime error 424

Posted on 2012-04-10
2
Medium Priority
?
799 Views
Last Modified: 2012-04-10
I'm trying to use the following code to move txt files to an archival directory.  But I get the attached error.

Dim strFolder As String
    Dim fso, txtFile
    strFolder = "C:\FTP\"

    txtFile = Dir(strFolder & "*.txt")

    While txtFile <> ""
      Debug.Print strFolder & txtFile
      txtFile.Move ("C:\FTP\Archive\")
      txtFile = Dir
     
    Wend
Untitled.png
0
Comment
Question by:JAMES125
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 37829473
Dim strFolder As String
    Dim fso, txtFile
    strFolder = "C:\FTP\"

    txtFile = Dir(strFolder & "*.txt")

    While txtFile <> ""
      Debug.Print strFolder & txtFile
     name strfolder & txtfile as "C:\FTP\Archive\" & txtFile
      txtFile = Dir
     
    Wend
0
 

Author Closing Comment

by:JAMES125
ID: 37829554
Aswesome, thanks again.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question