There's no restriction that the input side remain constant.
Dim strOldName As String
Dim strNewName As String
strOldName = "C:\Folder\File" & Format(Date, "yyyymmdd") & ".abc"
strNewName = "C:\Folder2\File" & Format(Date, "yyyymmdd") & ".txt"
If Len(Dir(strOldName)) > 0 Then
Name strOldName As strNewName
End If
(the Len(Dir(strOldName)) check ensures that the file actually exists before
you try renaming it)
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Mike G - DC" <(E-Mail Removed)> wrote in message
news:F879BEB6-F5BE-41E9-9BCD-(E-Mail Removed)...
> Thanks, that works. I'm new to VBA but was able to figure out how to
> create
> the function and include the step within my export macro using the
> OpenModule
> Action. This leads to another question though.
>
> My initial TransferText action included an expression within the File Name
> argument to append a date/time stamp. In using the Name Statement though,
> it
> looks like input side of the statement must remain constant, something
> like
> export.txt. Is there a way to append some additional VBA code to the
> output
> side of name statement to include the system date/time?
>
> Thanks again for the initial answer. Any additional help is greatly
> appreciated.
> - mike
>
>
>
> "Ken Snell MVP" wrote:
>
>> Export to a .txt file, then use the Name statement in VBA code to change
>> the
>> extension on the file.
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>> http://www.accessmvp.com/KDSnell/
>>
>>
>> "Mike G - DC" <(E-Mail Removed)> wrote in message
>> news:4FD99BF2-CE94-4947-9129-(E-Mail Removed)...
>> > Folks - I need a little help trying to export tables to text files with
>> > extensions that are not recognized by Access, .cmv & .cmo. I've tried,
>> > without luck, to implement the registry update referenced within the
>> > Access
>> > 2000 support file listed below. I'm either not implementing the
>> > registry
>> > update/macro correctly or the work around does not apply to Access
>> > 2007.
>> >
>> > ACC2000: How to Import a Text File That Has an Extension That Access
>> > Does
>> > Not Recognize
>> > http://support.microsoft.com/?id=306144
>> >
>> > I appreciate your ideas.
>> > - mike
>> >
>>
>>
>>