?
Solved

Access 2010 VBA Runtime error 424

Posted on 2012-04-10
2
Medium Priority
?
797 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

752 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