Solved

Access 2010 VBA Runtime error 424

Posted on 2012-04-10
2
796 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 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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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 …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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