Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Rename a text file with VBA or a macro in access

Posted on 2006-11-08
5
Medium Priority
?
1,343 Views
Last Modified: 2012-06-27
How can I use MS Access to rename a file in another folder?

I have a file...  c:\test\file.txt
I want to use Access to rename it (like the ren function in DOS) to c:\test\NEW.txt

How can I do this? Can I do this? Will Britney ever find love again?
0
Comment
Question by:niner
  • 2
  • 2
5 Comments
 
LVL 33

Accepted Solution

by:
hongjun earned 200 total points
ID: 17899306
You can do this


FileCopy C:\test\file.txt, C:\test\NEW.txt
Kill C:\test\file.txt
0
 

Author Comment

by:niner
ID: 17899373
How/where, in VBA?
0
 
LVL 33

Expert Comment

by:hongjun
ID: 17899386
Yes. in VBA
0
 
LVL 5

Expert Comment

by:MrNetic
ID: 17899410
That's pure VBSCRIPT, you can do as HonJun says .



Best Regards,

Paulo Condeça.
0
 

Author Comment

by:niner
ID: 17899445
Ah, I got it. Can this be extrapolated to like *.txt or does the first filename need to be explicit?
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

564 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