Solved

Access 2010 VBA Runtime error 424

Posted on 2012-04-10
2
787 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
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Set OWA language and time zone in Exchange for individuals, all users or per database.
This article will help you understand what HashTables are and how to use them in PowerShell.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now