[AccessD] How to Rename a flat file with Access VBA

Bob Gajewski rbgajewski at roadrunner.com
Fri Jun 24 08:04:50 CDT 2011


Try:

  Name Outbound.tbl As Outbound.txt

As long as the directory is not changing, that should work.

Or, if you need, you could use:

   Name Outbound.tbl As varNewPathName & "\" & Outbound.txt

Regards,
Bob Gajewski 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, June 24, 2011 08:45 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] How to Rename a flat file with Access VBA

All,

We just installed some EDI software that creates a number of flat files.

There is one file that is a text file but the extension is .tbl

I would like to link to this file with Access 2007, but I am running into
problems because of the .tbl extension.

For the short term, I am simply renaming the file outside of Access.
This works, but I would prefer to do the renaming inside of Access.

Is there a way to use VBA to rename flat files.

Example -
Old name = C:\EDI\Outbound.tbl
New name = C:\EDI\Outbound.txt

I figure that this is pretty easy to do, but I have never done it and I have
not found an example of how to do it.

Thanks in advance for your assistance.

Brad      

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list